-
-
Notifications
You must be signed in to change notification settings - Fork 245
[hyogshin] WEEK 03 solutions #1803
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.
마지막 개행 문자 추가 후 머지 해주시길 바랍니다. 수고하셨습니다 :)
def isPalindrome(self, s: str) -> bool: | ||
alnum = [] | ||
is_pal = True | ||
for c in s: |
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.
-> alnum = [c.lower() for c in s if c.isalnum()]처럼 한 줄로 간결하게 작성 가능
is_pal = False | ||
break | ||
|
||
return is_pal |
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.
is_pal 변수를 쓰지 않고 불일치 시 바로 return False를 하고 마지막에 return True만 남기면 더 간단해집니다
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 하나 이상을 반드시 검토를 해주셔야 합니다!