-
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
[혜준] Week1 문제 풀이 #308
[혜준] Week1 문제 풀이 #308
Conversation
|
||
const set = new Set(nums); | ||
|
||
return nums.length !== set.size ? true : false; |
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.
return nums.length !== set.size;
넵! 이해했습니다. 의견 감사합니다!
palindromic-substrings/hyejjun.js
Outdated
/* | ||
Time Complexity : O(n^2) | ||
Space Complexity: 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.
파일 마지막에 line break 추가 부탁드립니다!
사용하시는 에디터를 잘 모르지만, 에디터 설정에서 자동 적용 기능이 있는지 찾아보시면 좋을 것 같습니다!
let val = n.toString(2); | ||
|
||
let res = 0; | ||
[...val].forEach((val) => res += parseInt(val)) |
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.
안녕하세요 @hyejjun 님!
해당 코드에서는 사용자가 직접 toString(2)
로 2진수로 변환한 안전한 문자열이므로 parseInt(val)
�은 굳이 사용하지 않아도 좋을 것 같습니다!
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.
네! 피드백 감사합니다!
초안입니다. (복잡도 분석 후 추가 예정)