Python solution


  • 0
    A
    def canAttendMeetings(self, intervals):
        """
        :type intervals: List[Interval]
        :rtype: bool
        """
        allIntervals = sorted(intervals,key=lambda x: x.start)
        for i in xrange(len(allIntervals) - 1):
            if allIntervals[i].end > allIntervals[i+1].start:
                return False
        return True

Log in to reply
 

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