Poor code editor

I am trying to submit my code but its not submitting.

for _ in range(int(input())):
n=int(input())
mod=10**9+7
dp=[0]*(n+1)
dp[1]=2
dp[0]=1
def recurse(n):
if dp[n]!=0:
return dp[n]
if n<0:
return 0
else:
dp[n]=recurse(n-1)+recurse(n-2)
return dp[n]
print(recurse(n)%mod)

hi @govilayush please share your code using CB IDE

@govilayush your code is using wrong formula, this is why it is giving wrong answer.
the recursive relation is f(n) = f(n-1) + f(n-2) * nC1

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.