My code is giving wrong output

@simi_1188,
You should dry run on the 1st sample test case.

I DID DRY RUN BUT COUDNT FIND ANY MISTAKE

@simi_1188,
The best way to debug dp is to print the dp table and see which cell has a wrong value, you should try that.