prog.cpp:3:12: error: ‘string’ has not been declared
int helper(string s,int n,vector<int> &dp){
^~~~~~
prog.cpp:3:27: error: ‘vector’ has not been declared
int helper(string s,int n,vector<int> &dp){
^~~~~~
prog.cpp:3:33: error: expected ‘,’ or ‘...’ before ‘<’ token
int helper(string s,int n,vector<int> &dp){
^
prog.cpp:27:18: error: ‘string’ has not been declared
int numDecodings(string s) {
^~~~~~
prog.cpp: In member function ‘int Solution::helper(int, int, int)’:
prog.cpp:4:7: error: invalid types ‘int[int]’ for array subscript
if(s[0] == '0'){
^
prog.cpp:5:8: error: ‘dp’ was not declared in this scope
return dp[n] = 0;
^~
prog.cpp:9:9: error: ‘dp’ was not declared in this scope
dp[n] = 1;
^~
prog.cpp:11:8: error: ‘dp’ was not declared in this scope
if(dp[n]!= -1){
^~
prog.cpp:14:5: error: ‘dp’ was not declared in this scope
dp[n]=0;
^~
prog.cpp:15:13: error: invalid types ‘int[int]’ for array subscript
if(s[n-1] > '0'){
^
prog.cpp:19:14: error: invalid types ‘int[int]’ for array subscript
if((s[n-2] == '1') || (s[n-2] == '2' && s[n-1] < '7')){
^
prog.cpp:19:33: error: invalid types ‘int[int]’ for array subscript
if((s[n-2] == '1') || (s[n-2] == '2' && s[n-1] < '7')){
^
prog.cpp:19:50: error: invalid types ‘int[int]’ for array subscript
if((s[n-2] == '1') || (s[n-2] == '2' && s[n-1] < '7')){
^
prog.cpp: In member function ‘int Solution::numDecodings(int)’:
prog.cpp:28:15: error: request for member ‘size’ in ‘s’, which is of non-class type ‘int’
int n = s.size();
^~~~
prog.cpp:29:5: error: ‘vector’ was not declared in this scope
vector<int> dp(n+1,-1);
^~~~~~
prog.cpp:29:12: error: expected primary-expression before ‘int’
vector<int> dp(n+1,-1);
^~~
prog.cpp:30:26: error: ‘dp’ was not declared in this scope
int ans = helper(s,n,dp);
^~
prog.cpp:32:9: error: ‘cout’ was not declared in this scope
cout << dp[i] << " ";
^~~~