Please Somebody explain me the problem DELARRAY

I am unable to understand how we are getting the answer in problem test cases.
Please, somebody, explain to me the Problem DELARRAY

The first test case was 1 1 2.
So, you can either delete the first 1(at index 0) or you can delete the second 1(at index 1), then you can also delete both the 1s and finally you have the choice to delete 1(at index 1) and 2 together. Thus, giving the total answer to be 4.

We have to consider repeating elements as a single case?

please explain second test case also

No, you have to consider a continuous sequence, a continuous sequence is one that starts at some index i and ends at some other index j but skips no element between i and j, in other words it contains every element in the range [i, j]. It just happens by coincidence that continuous sequence here contains repeated elements.
Note - the other condition is that you must also delete in such a way that the remaining sequence is strictly increasing, that is the reason you can’t remove only 2 as 1 1 is not strictly increasing.

input - 2 4 3 5
possible cases of deletion-
2 4 5 --> 1
2 4 --> 2
2 3 5 --> 3
2 5 --> 4
2 --> 5
3 5 -> 6
5 -> 7
hence the output 7.

Thanks, I got it.:slightly_smiling_face:

Read the problem again, you have to delete a non empty continuous sequence doing a deletion at index 0 and then index 2 means deleting a non continuous sequence or deleting two different continues sequences either of which is not allowed.

Yes, I got it. Thanks