Maximize Active Section with Trade I

Solution Code

Time Complexity

O(n)

Space Complexity

O(1)