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

Sign in to watch this lesson
Algorithms - Greedy · 4:07
To accept the most non-overlapping requests on one resource, sort by end time and take every request that starts no earlier than the last one taken ends: on [1,3] [2,5] [4,6] [6,8] [5,9] [8,10] that keeps four. We prove it with 'greedy stays ahead', settle whether touching endpoints conflict, and break the two tempting wrong keys (earliest start, shortest first) with counterexamples and a stress test on 5000 random inputs. Then the covering twin: fill the trading day [0, 10] with the fewest shifts by always jumping to the farthest reach.