Loading...
Loading...
Loading...
A person has a list of meetings with start and end times. A meeting may start at the same minute the previous one ends. Print YES if the person can attend all of them, otherwise NO. The meetings are not in order.
Example 1
Input
3 0 30 5 10 15 20
Output
NO
Example 2
Input
2 7 10 2 4
Output
YES
Try the problem first. Open one hint at a time.
Sort by start time.
After sorting, only neighbours can clash: compare each start with the previous end.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor