Maximize Active Section with Trade II

Solution Code
Video GuideLeetcode Daily

Time Complexity

O((N + Q) log N)

Space Complexity

O(N log N)