Https://hack.codingblocks.com/contests/c/452/136

https://hack.codingblocks.com/contests/c/452/136
my output is coming right but it is giving wrong answer for both test cases.
MY CODE:https://ide.codingblocks.com/#/s/19127

nitish i have done using Dp its complexity got reduced futher my code complexity can also reduced by making checkpoints. see this
https://ide.codingblocks.com/#/s/19132

1 Like

u have done a silly mistake i have commented check this
https://ide.codingblocks.com/#/s/19133
if any problem reply
Happy Coding!

after that mistake it is also giving wrong answer in test cases.i am not able to figure it out my mistake.please help me out.

this https://ide.codingblocks.com/#/s/19132 your code has worked.awesome code:slightly_smiling_face::slightly_smiling_face::slightly_smiling_face

ok i will mark ur mistake and then post the link of ur code

check this
https://ide.codingblocks.com/#/s/19246