-
-
Notifications
You must be signed in to change notification settings - Fork 195
[bhyun-kim, bh_kim] Solution for week1 assignments #40
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
마지막 줄에 line break를 추가해주시면 좋을것 같습니다...! |
각 파일 마지막줄에 line break 추가하였습니다! |
여전히 ⛔ 표시가 있는 걸로 봐서는 line break가 제대로 들어가지 않은 것 같습니다 😅 사실 이런 사소한 작업은 직접 하시기 보다는 코드 포멧팅 도구를 통해서 코드 에디터에서 저장하실 때마다 자동으로 일어나게 하는 것이 좋습니다. 파이썬에서는 Black이라는 포멧터가 많이 사용되오니 이 블로그 글을 참고 바랍니다. https://www.daleseo.com/python-black/ |
valid-palindrome/bhyun-kim.py
Outdated
s = s.lower() | ||
s = list([c for c in s | ||
if c.isalpha() or c.isnumeric()]) | ||
s = "".join(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.
굳이 문자열로 다시 재변환 할 필요가 있을까요? 이 줄을 지우면 그냥 리스트 간 비교가 될 것 같네요.
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.
문자열 변환과 리스트 변환 중복을 제거했습니다. 리트코드 홈페이지에서 실행하니 평균적으로 10% 정도 속도가 줄어들었네요!
valid-palindrome/bhyun-kim.py
Outdated
s = list([c for c in s | ||
if c.isalpha() or c.isnumeric()]) |
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.
이미 리스트인데, list()
함수로 감싸는 것은 불필요한 것 같습니다.
s = list([c for c in s | |
if c.isalpha() or c.isnumeric()]) | |
s = [c for c in s | |
if c.isalpha() or c.isnumeric()] |
알려주신대로 black 이용해서 포메팅 해봤습니다. 이렇게 - 표시가 뜨지 않으면 정상적으로 처리 된 것일까요? |
네 이번에는 line break가 잘 추가가 된 것 같습니다 👏👏 |
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.
수고하셨어요! 깔끔하게 잘 작성해주셨네요 👍
Please review the pull request for the Week 1 assignments. You can find details about the solutions in the comments within each file.