Car Pooling: Difference Arrays Meet Interval Events
Capacity checking with +passengers/−passengers events on a number line. Python solution and complexity analysis for the merge intervals interview pattern.
Tag
Articles tagged Merge Intervals on The Augmented Dev.
11 articles
Capacity checking with +passengers/−passengers events on a number line. Python solution and complexity analysis for the merge intervals interview pattern.
Common free intervals across k schedules — flatten, merge, read the gaps. Python solution and complexity analysis for the merge intervals interview pattern.
Exploit existing sortedness: before, absorb, after — three phases. Python solution and complexity analysis for the merge intervals interview pattern.
Intersect two sorted interval lists with merge-style pointers. Python solution and complexity analysis for the merge intervals interview pattern.
Can one person attend every meeting? Sort and scan adjacent pairs. Python solution and complexity analysis for the merge intervals interview pattern.
Peak concurrent meetings — the min-heap of end times, plus the sweep line. Python solution and complexity analysis for the merge intervals interview pattern.
Collapse overlapping intervals — the question every FAANG loop reuses. Python solution and complexity analysis for the merge intervals interview pattern.
Group intervals sharing a common point — activity selection inverted. Python solution and complexity analysis for the merge intervals interview pattern.
Design a booking class — the two-sided overlap predicate under test. Python solution and complexity analysis for the merge intervals interview pattern.
Minimum removals to make intervals disjoint — sort by end, keep greedily. Python solution and complexity analysis for the merge intervals interview pattern.
Turn a sorted array into a->b range strings — clean run detection. Python solution and complexity analysis for the merge intervals interview pattern.