Description:
Solution:
In this problem, we are gonna compare the end of the previous interval to the start of the current interval.
If the new start point is bigger than prevEnd, we don't count.
Else, it is overlapping, so that we count them as 1. And update prevEnd.
Since, new intervals are still overlapping, we should use the min(end, prevEnd).
Time Complexity: O(nlogn)
'LeetCode ๐๏ธ > Interval' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
38. Meeting Rooms II (0) | 2023.06.27 |
---|---|
37. Meeting Rooms (0) | 2023.06.26 |
56. Merge Intervals (0) | 2023.06.24 |
57. Insert Interval (0) | 2023.06.23 |