Highest individual value is not the global optimum
One long high-value change can overlap several shorter changes whose combined value is larger. After sorting by end time, the optimum for the first i intervals either excludes interval i or includes it plus the optimum ending no later than its start.
Predecessor search keeps the recurrence efficient
For half-open intervals [start,end), touching boundaries are compatible. End times are sorted, so `partition_point(end <= start)` finds how many earlier intervals may precede the current one. One sort plus N binary searches yields O(N log N) time and O(N) DP state.