Sponsored
Use these hints if you're stuck. Try solving on your own first.
Try solving the problem for one interval.
Using the solution with one interval, how can you combine that with a second interval?
Solve with full IDE support and test cases