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.
1 parent ea27d10 commit 5e4edb4Copy full SHA for 5e4edb4
meeting-rooms/jaejeong1.java
@@ -16,7 +16,10 @@ public class Solution {
16
* @return: if a person could attend all meetings
17
*/
18
public boolean canAttendMeetings(List<Interval> intervals) {
19
- // Write your code here
+ // 풀이: 정렬 후 양옆을 비교해가며 조건에 맞지 않으면 false 를 반환한다.
20
+ // TC: O(N)
21
+ // SC: O(1)
22
+
23
var sortedIntervals = intervals.stream().sorted().toList();
24
25
for (int i=0; i<sortedIntervals.size()-1; i++) {
0 commit comments