Clean Python Solution


  • 0
        def canAttendMeetings(self, intervals):
            intervals.sort(key=lambda x: x.start)
            
            for i in range(len(intervals)-1):
                if intervals[i].end > intervals[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.