What could possibly be wrong here
#include
using namespace std;
char exp[5001];
int deepee[5000];
void init()
{
for(int i = 0; i<5000; i++)
deepee[i]=-1;
}
int dp(int ind)
{
if(deepee[ind]!=-1)
return deepee[ind];
if(exp[ind]==‘0’)
return 0;
if(exp[ind]==’\0’)
{
deepee[ind]=1;
return 1;
}
int a = 0, b = 0;
a = dp(ind+1);
if(exp[ind+1]==’\0’)
deepee[ind]=a;
else if((10*(exp[ind]-48)+(exp[ind+1]-48)) > 26)
deepee[ind]=a;
else
{
b = dp(ind+2);
deepee[ind] = a+b;
}
return deepee[ind];
}
int main()
{
int count;
while(true)
{
cin>>exp;
if(exp[0]==‘0’)
break;
init();
count = dp(0);
cout << count << endl;
}
return 0;
}