Can please anyone help me out . I came up with this strategy to this problem. Can anyone tell me what is rong about my strategy since it is giving rong answer. I tried a lot but I'm unable to think of any test case for which my code will give rong answers. I even tried the spojtoolkit test cases.This is my code. I did it using DP with a 1d array.