Help with approach

solution: https://ide.codingblocks.com/s/405349
prob: https://hack.codingblocks.com/app/contests/2022/439/problem

please give some hint about what is wrong in this code

Hey @raghav007

I’m having a bit of hard time with recursion when it comes to non trivial problems, I realize that it is a very important concept please give me some guidance as to how to master it.

Dry run your code for every recursion problem u are doing this will help u visualize better

there is one problem I want you to see, I showed it to some other TA but they were saying that the something is wrong with question, but I know this is not the case, should I show you here or post a new doubt

Open another doubt
Incase I dont get it I will look here

prob: https://hack.codingblocks.com/app/contests/2022/250/problem

sol: https://ide.codingblocks.com/s/405380