fork download
  1. class Interval(object):
  2. def __init__(self, s=0, e=0):
  3. self.start = s
  4. self.end = e
  5.  
  6. class Solution(object):
  7. def canAttendMeetings(self, intervals):
  8. """
  9. :type intervals: List[Interval]
  10. :rtype: bool
  11. """
  12. intervals.sort()
  13.  
  14. for i in range(1, len(intervals)):
  15. if intervals[i].start < intervals[i-1].end:
  16. return False
  17.  
  18. return True
  19.  
  20. B = Solution()
  21. print B.canAttendMeetings([Interval(20,30),Interval(25,30)])
  22.  
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
False