interesting encoding

i don’t know why the test cases are not passing can anyone have look :
#include
using namespace std ;

int ways(string s){
int n =s.size();
if(n==0){
return 1;
}
if(n==1){
return 1;
}
int *dp = new int[n+1] ;
dp[0] = 1;
dp[1] = 1;
for(int i=2 ;i<=n ;i++){
dp[i] = dp[i-1];
if((s[i-2]-48)!= 0 && ((s[i-2]-48)*10 + (s[i-1]-48) <=26)){
dp[i] += dp[i-2];
}
}

return dp[n];

}
int main(){
int t ;
cin >> t ;
string s ;
while(t–){
cin >> s ;
int ans = ways(s);
cout << ans << endl;
}
return 0 ;