Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try using the sliding window technique.
Use a set or map to keep track of the maximum and minimum of subarrays.
Solve with full IDE support and test cases