You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: solution/0200-0299/0252.Meeting Rooms/README_EN.md
+14-29
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,13 @@ tags:
42
42
43
43
<!-- solution:start -->
44
44
45
-
### Solution 1
45
+
### Solution 1: Sorting
46
+
47
+
We sort the meetings based on their start times, and then iterate through the sorted meetings. If the start time of the current meeting is less than the end time of the previous meeting, it indicates that there is an overlap between the two meetings, and we return `false`. Otherwise, we continue iterating.
48
+
49
+
If no overlap is found by the end of the iteration, we return `true`.
50
+
51
+
The time complexity is $O(n \times \log n)$, and the space complexity is $O(\log n)$, where $n$ is the number of meetings.
0 commit comments