Hello
in this problem I don’t really understand at all why are we breaking the segment [L,R] into two contiguous parts.
for example in the third nested loop what does it even mean to try multiple different break points ?
the editorial in hint 1 assumed that only because it work on a case like [1 1] then it must work on all other cases
maybe I’m overlooking something . any help would be appreciated
I understand the reason why we can spilt when endpoints are not the same, because it can be proved that in the optimal solution, two intervals are either disjoint or one completely contains another, and since there can’t exist an interval that contains the whole array, we can split it into two disjoint subproblems.
But in the case that two endpoints are the same, I’m confused that why can we spilt it into two disjoint subarrays and compute them independently?