Skip to content

Meeting Rooms

EasyPython 3ArraysSorting

You are given a list intervals where intervals[i] = [start, end] is a meeting running from start (inclusive) to end (exclusive), in no particular order. Return True if one person could attend every meeting, i.e. no two meetings overlap. A meeting may start exactly when another one ends.

Constraints:
  - 0 <= len(intervals) <= 10^4
  - starts and ends are integers, start < end
Examples:
  [[0, 30], [5, 10], [15, 20]] -> False  ([0, 30] overlaps both others)
  [[7, 10], [2, 4]]            -> True
  [[1, 5], [5, 8]]             -> True   (back-to-back is fine)
  []                           -> True

Python 3, run in your browser. Run tests runs the problem's own tests with a free account; the AI interviewer reads your code and your runs in a practice interview.

Loading the editor…