252. Meeting Rooms

https://leetcode.com/problems/meeting-rooms/

Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings.

Example 1:

Input: [[0,30],[5,10],[15,20]]
Output: false

Example 2:

Input: [[7,10],[2,4]]
Output: true
---
Related problems
---
Intuition
Check for overlaps, if overlap => false
To check for overlaps, we need to pick one way of ordering rooms

Sort by start time or end time ascending - doesn't matter which time

If start time of current < end time of previous => overlap => return false
---
Time - O(N log N)
Space - O(1)
---