[LeetCode]Meeting Rooms
public class Solution { public boolean canAttendMeetings(Interval[] intervals) { Arrays.sort(intervals, new Comparator<Interval>() { public int compare(Interval o1, Interval o2) { return o1.start - o2.start; } }); Interval pre = new Interval(-1, -1); for (Interval inte: intervals) { if (inte.start < pre.end) { return false; } pre = inte; } return true; } }