Maximum Score of Non-overlapping Intervals

Solution Code

Time Complexity

O(n log n + n k^2)

Space Complexity

O(n k^2)