-
-
Notifications
You must be signed in to change notification settings - Fork 247
[hyunjung-choi] WEEK 03 solutions #1780
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
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.
전체적으로 깔끔한코드네요. 시간복잡도랑공간복잡도 주석만 달아주면 좋을것 같습니다
@@ -0,0 +1,3 @@ | |||
class Solution { | |||
fun hammingWeight(n: Int) = Integer.bitCount(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.
코틀린에 깔쌈한 내장함수가있나보군요
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.
넵 저도 이번에 처음 알았습니다 ㅎㅎ
fun isPalindrome(s: String): Boolean { | ||
if (s.isBlank()) return true | ||
val cleanedString = s.trim().filter { it.isLetterOrDigit() }.lowercase(getDefault()) | ||
return cleanedString == cleanedString.reversed() |
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
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!