Python simple answer


  • 0
    class Solution(object):
        def canAttendMeetings(self, intervals):
            intervals.sort(key = lambda x: x.start)
            rightMost = -1
            for interval in intervals:
                if interval.start < rightMost:
                    return False
                else:
                    rightMost = interval.end
            return True
    

Log in to reply
 

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