ā back to unit
Challenge
# sorting advanced
Do the Playdates Clash?
Every playdate has a start hour and an end hour ā can one kid attend them ALL? šļø
You get the starts on one line and matching ends on the next (playdate i runs from starts[i] to ends[i]). Print clash if any two overlap, otherwise all good. (Ending at 3 and starting at 3 is fine.)
Example:
Input: starts = [1, 5, 3], ends = [2, 7, 4]
Output: all good
Sorting by start time gives (1,2), (3,4), (5,7) ā each playdate ends at or before the next one starts, so nothing overlaps.
š” need a hint?
sort-playdates-clash.pyš given lines are locked ā write your code in between
loading...