2 lines Python solution


  • 0
    C
    def canAttendMeetings(intervals):
            intervals.sort(cmp = lambda x, y: cmp(x.start, y.end))
            return not any([intervals[i-1].end > intervals[i].start for i in xrange(1, len(intervals))])

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.