sessions[i] = [start, end] means the session begins at time start and ends at time end. A studio can host only one session at a time, but if a session ends at time t, another one may start in the same studio at that same moment t.
Return the smallest number of studios that lets every session run at its scheduled time.sessions=[[9, 12], [10, 11], [11, 14], [13, 15]] → 2
[9, 12] and [10, 11] run at the same time. [11, 14] takes the studio freed at 11, and [13, 15] the one freed at 12. Two are enough.
sessions=[[1, 5], [2, 6], [3, 7]] → 3
At time 3 all three sessions are running, so three studios are needed.
sessions=[[4, 8]] → 1
sessions=[[9, 12], [10, 11], [11, 14], [13, 15]]
2
Run checks the first 3 tests in your browser. Submit checks all 102 tests on the server, hidden ones included.