5 hands-on exercises and 5 find-the-bug challenges for the Merging and Sorting Intervals lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Merge overlapping ranges and report how many remain.
Report whether two ranges overlap.
Report whether ranges that meet at a point overlap.
Find the greatest number of ranges active at once.
Show the end of the first merged range.
Unsorted ranges cannot be merged in a single pass.
A contained range must not shrink the one already merged.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceBoth conditions must hold for two ranges to overlap.
A range ending at the same instant frees its slot before the next begins.
Pushing the original array lets a later change alter the source.