-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Jeehay28] Week 4 #812
[Jeehay28] Week 4 #812
Conversation
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.
@Jeehay28 님 2024년 한 해 고생 많으셨습니다!
2025년 한 해도 복 많이 받으시길 바라며 리뷰 드렸고, 앞으로도 많은 참여 부탁드려요!
아직 풀이중이시니 코멘트만 남기고 가겠습니다!
// Time complexity: O(n)(two loops: one for numbers 0 to n and one for array elements) | ||
// Space complexity: O(1) | ||
|
||
var missingNumber = function (nums) { |
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.
오.. XOR 풀이도 신기하네요!
이미 복잡도는 최대치이긴 하지만, 아래와 같이 순회하면 순회를 절반으로 줄여서 성능을 거의 두배로 올릴 수 있을것 같은데요?!
for (let i = 0; i < n; i++) {
xor = xor ^ i ^ nums[i];
}
merge-two-sorted-lists/Jeehay28.js
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.
고생하셨습니다!
재귀도 효율적이지만 반복문으로 SC를 O(1)로 최적화하는 방법도 추가로 고려해보면 좋을 것 같습니다.
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.
My own approach부분도 잘 봤습니다
문제의 전제가 중복된 숫자가 없는 배열이라
let distinctNums = new Set(nums);으로 작성해도 동작하네요
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.
이번 주도 고생하셨습니다🙂
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.