-
-
Notifications
You must be signed in to change notification settings - Fork 195
[sun] W1 Solutions #315
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
[sun] W1 Solutions #315
Conversation
sun912
commented
Aug 12, 2024
•
edited
Loading
edited
- contains-duplicate
- number-of-1-bits
- Top K Frequent Elements
- Kth Smallest Element In a Bst
- Palindromic Substrings
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.
힘내세용 :)
result += n % 2 | ||
n = n//2 | ||
|
||
return result |
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가 빠져있네요.
참고: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
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.
옷, 파일 마지막에 line break가 빠져있네요. 참고: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
저는 Python 컨벤션으로 알고 있었는데, 근본의 UNIX 기원이군요 감사합니다
result += n % 2 | ||
n = n//2 | ||
|
||
return result |
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가 빠져있네요. 참고: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
저는 Python 컨벤션으로 알고 있었는데, 근본의 UNIX 기원이군요 감사합니다
if len(result) == k: | ||
return result |
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.
early return으로 실행 속도 이득을 보는 것도 좋지만, 함수 시그니처에 맞춰서 return을 보장해주는 것도 좋다고 생각합니다