Hello CodeChef Community,
Here is the Question Link from Ittiam Think challenge 2017 on Hackerearth
I attempted this problem but it got partially accepted.I can change my recursive approach to iterative one to avoid TLE but I don’t know why I am getting WA in some of test cases with this solution.
Here is my solution link.
Please point out my mistake