TIlling Problem - II

I have written the code using recursion but the test case are still giving TLE error, please help me with how do I resolve that?

hi @aryangoel971_1b263dfa601b9409 updated https://ide.codingblocks.com/s/667021