Refer for code: -
Wrong Answer in all test cases
Your code is giving wrong output for the sample test case. The recursive relation is same as that of a fibonacci sequence.
Check now:
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: