Gamified challenge · Greedy choice
Each entry of talks is [start, end] with start < end. A hall can host only one talk at a time, but a talk that ends at time t leaves the hall free for one that starts at t.
Write maxTalks(talks) that returns the largest number of talks the hall can host. For [[0, 10], [1, 2], [3, 4], [5, 6]] the answer is 3: skip the long keynote and run the three short talks.
An empty list hosts 0 talks.
This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.
Sign in with Google