Skip to content

Commit f824e4d

Browse files
authored
Merge pull request #2318 from DaleSeo/main
[DaleSeo] WEEK 13 solutions
2 parents 17e8042 + 141093e commit f824e4d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

meeting-rooms/DaleSeo.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)