-
-
Notifications
You must be signed in to change notification settings - Fork 195
[mallayon] Week 13 #1069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mallayon] Week 13 #1069
Conversation
function canAttendMeetings(intervals: number[][]): boolean { | ||
intervals.sort((a, b) => a[0] - b[0]); | ||
|
||
for (let i = 1; i < intervals.length; i++) { | ||
const previousMeetingTime = intervals[i - 1]; | ||
const currentMeetingTime = intervals[i]; | ||
if (currentMeetingTime[0] < previousMeetingTime[1]) return false; | ||
} | ||
|
||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmyeon 님 안녕하세요. 저도 같은 방식으로 문제를 풀었습니다. 아직 문제를 푸는 중이신 것 같네요! 주말까지 파이팅입니다 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KwonNayeon 님 안녕하세요!
이번 주 리뷰 요청이 늦었네요ㅠㅠ 시간 내어서 리뷰 해주셔서 정말 감사합니다!
이번 주도 문제 푸느라 정말 고생 많으셨어요 👍
벌써 13주라니 놀라워요. 남은 기간도 같이 힘내보아요. 즐거운 주말 되세요!! 😄
insert-interval/mmyeon.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시간 복잡도를 O(n) 으로 풀이 하려면 어떻게 하면 될까요 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
재정렬하던 로직 제거하고, newInterval를 intervals 배열안에 삽입하도록 개선했습니다!
꼼꼼한 리뷰 감사합니다 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변수 count 를 사용하여 공간 복잡도를 O(h) h 는 재귀스택, 으로 잘 풀어내신것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
13주차 리트코드 문제 풀이 고생 많으셨습니다!
3기 참여중 못푸신 문제 혹은 아쉬우신 부분이 있으시다면 4기 재참여 해보시는 건 어떨까요?
14주차 문제 풀이도 파이팅입니다!
@TonyKim9401 |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.