Sir the editorial is given of this problem is of Dynamic programming, can you give a recursive solution. My solution is passing a test case and failing other because of TLE. I think this is because time limit is set not for 2^n but to o(n).
This is my code and its giving correct output as per i checked.