# 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...