Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), determine if a person could attend all meetings.
For example,
Given [[0, 30],[5, 10],[15, 20]],
return false.
解法1:O(NlogN) Time
考察的是对custom class排序的能力,我们只需要用标准的库函数,用上自己定义的比较函数就可以了。比较的时候后一个meeting的开始时间不能早于前一个会议的结束时间。
C++
Java