⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 10s17 days 22 hours 20 minutes 10 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 10s17 days 22 hours 20 minutes 10 seconds.

Sign in to watch this lesson
Algorithms - Greedy · 4:14
When every meeting must happen, the number of rooms needed is the largest number running at once. We turn the meetings [1,4) [2,5) [3,6) [5,7) [6,8) into +1/-1 events, sweep them in time order with ends before starts at equal times, and watch the count peak at 3; the wrong tie order reports two rooms for two back-to-back meetings. A min-heap of free times then assigns the rooms, reusing them as they free up. We connect the sweep to difference arrays, time two million events on this Mac, and handle the live-feed version with a heap of close times.