We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 17e8042 + 141093e commit f824e4dCopy full SHA for f824e4d
1 file changed
meeting-rooms/DaleSeo.rs
@@ -0,0 +1,8 @@
1
+// TC: O(n logn)
2
+// SC: O(1)
3
+impl Solution {
4
+ pub fn can_attend_meetings(mut intervals: Vec<Vec<i32>>) -> bool {
5
+ intervals.sort_by_key(|i| i[0]);
6
+ intervals.windows(2).all(|w| w[0][1] <= w[1][0])
7
+ }
8
+}
0 commit comments