getting wrong answer in two cases
Wrong answer in two cases
@singh.vishen09
The correct relations will be these:-
dp[i][0]=dp[i-1][1] + dp[i-1][0];
dp[i][1]=dp[i-1][0];
Also change the return type of your function to long long int.
I am also attaching the corrected code for your reference, refer to it only if you need it.