Please Explain the logic for this problem

Here’s the working code : CodeChef: Practical coding for everyone

You did not take no of test cases into consideration, and few other things like that filldp() function were not needed (although not incorrect)

1 Like

Thanks a lot…Happy Coding