1 Like

Have a look at this

```
#include <bits/stdc++.h>
#define MOD 1000000007;
using namespace std;
int countDecoding(string digits, int n)
{
if (n == 0 || n == 1)
return 1;
if (digits[0]=='0')
return 0;
int count = 0;
if (digits[n-1] > '0')
count = countDecoding(digits, n-1) % MOD;
if (digits[n-2] == '1' ||
(digits[n-2] == '2' && digits[n-1] < '7') )
count += countDecoding(digits, n-2) % MOD;
return count % MOD;
}
int main()
{
int tt;
cin >> tt;
while(tt--){
string str;
cin >> str;
int n = str.length();
cout << countDecoding(str, n) << endl;
}
return 0;
}
```

What’s wrong in this code?

Please dont spam in discussion forum we have different thread for different topics ,Please respect it !!