l=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
for _ in range(int(input())):
n=int(input())
s=str(n)
dp=[0]*(len(s)+1)
dp[0]=1
p=int(s[0]+s[1])
if p in l:
dp[1]=2
else:
dp[1]=0
for i in range(2,len(s)):
p=int(s[i])
p1=int(s[i-1]+s[i])
if p in l:
dp[i]=dp[i-1]
if p1 in l:
dp[i]=dp[i]+dp[i-2]
print(dp[len(s)-1])
Getting error in the test cases 0,2 and 5.
Getting error in the test cases 0,2 and 5
Please share the link of Code
How to Share Link of Code??
-
paste your code at https://ide.codingblocks.com/
-
click->file->save
-
after a link will be generated at top in place of url something like: https://ide.codingblocks.com/s/12345
-
share this link
1
12101210
for this input correct output is 4
but your code is giving 7
your approach is not completely correct
first think something more and
if not able to find solution then i will help