10253. Meeting Rooms II

You are given a list of time intervals representing the start and end times of various events. Each interval is a string formatted as start, end where start < end. You will have to split the string and extract start and end.

Also intervals are half open. [start, end) , meaning interval [1,3) doesn't overlap with interval [3,5)

Determine the minimum number of rooms required so that no two events overlap in the same room.

Examples

Example 1:
Input: ["1, 10", "2, 6", "5, 15"]
Output: 3

Example 2:
Input: ["8, 12", "1, 3", "5, 7"]
Output: 2

Example 3:
Input: ["4, 8", "9, 12"]
Output: 1

Constraints

  • 1 ≤ number of intervals ≤ 12,000
  • 0 ≤ start < end ≤ 100,000
  • Intervals may overlap in any order




Please use Laptop/Desktop or any other large screen to add/edit code.