Is my code correct?it's showing right output but test cases are not passing

Hey @supratik260699 , your this approach is not working as it is not giving the correct recurrence relation and there is no need to use 2D DP for this problem, you can solve this problem using 1D DP only by taking 2 arrays of size n.
And recurrence relation for this problem is

arr1[i] = arr1[i - 1] + arr2[i - 1]
arr2[i] = arr1[i - 1] 

One more thing is if you observe carefully, you will find that the count is (n+2)th fibonacci number for n >= 1, So you can use that approach also.

Hope this helps you :grinning: