-
-
Notifications
You must be signed in to change notification settings - Fork 297
[dev_qorh] WEEK1 solutions #2001
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
base: main
Are you sure you want to change the base?
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.
현재 시간 기준으로 two-sum, house-robber가 커밋되어있는데
PR 내용에는 two-sum 대신 contains-duplicate가 체크되어있습니다
| } | ||
|
|
||
| return f(0); | ||
| } |
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.
마지막 라인에 개행 문자가 빠져있습니다
two-sum/dev_qorh.ts
Outdated
| let temp_i = 0; | ||
| let temp_j = 0; | ||
|
|
||
| for (let i = 0; i < nums.length; i++) { | ||
| temp_i = nums[i]; | ||
| for (let j = i + 1; j < nums.length; j++) { | ||
| temp_j = nums[j]; | ||
|
|
||
| if (temp_i + temp_j === target) { | ||
| return [i, j]; | ||
| } | ||
| } | ||
| } |
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.
temp 변수들이 nums[i], nums[j]로 초기화하고 비교만 하는 방식이면
변수 선언 없이 nums만 사용해도 좋을 것 같습니다.
for (let i = 0; i < nums.length; i++) {
for (let j = i + 1; j < nums.length; j++) {
if (nums[i] + nums[j] === target) {
return [i, j];
}
}
}
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.
감사합니다! 반영했습니다
| } | ||
|
|
||
| return []; | ||
| } |
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.
마지막 라인에 개행 문자가 빠져있습니다
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.
ci 를 정상통과 하는 것으로 보아, 적용이 되어 있는 것 같습니다. 확인 감사합니다!
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!