Wrong Answer in all test cases

Refer for code: -

Your code is giving wrong output for the sample test case. The recursive relation is same as that of a fibonacci sequence.
Check now:

Thanks @pratyush63
All testcases passed successfully.