what’s the problem with this code:https://ide.codingblocks.com/s/219392.
It passes only 2 test cases
1 count problem from DP section
@Naveen8377
Here the mistake is when you are printing the array with ‘l’ and ‘r’ that might have been changed and not the one which we have for max_length.
So, while updating max_length also save that ‘l’ and ‘r’.
Rest all the things are correct.
Also, please mark this doubt as resolved if you got it.