Not sure why is it not working


#1

int solve(string A,int i){
if(i==A.size())
return 1;
if(t[i]!=-1)
return t[i];
if(i+2<=A.size())
{
int temp=(A[i]-‘0’)*10+A[i+1]-‘0’;
if(temp<27&&temp>0)
return t[i]=(solve(A,i+1)%MOD+solve(A,i+2)%MOD)%MOD;
}
return t[i]=solve(A,i+1)%MOD;
}