-
-
Notifications
You must be signed in to change notification settings - Fork 245
[hyer0705] WEEK 02 solutions #1765
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
while (j < k && nums[j] === nums[j - 1]) j++; | ||
while (j < k && nums[k] === nums[k + 1]) k--; |
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.
Map을 하나만 설정해서 s는 +, t는 -를 진행하고 마지막에 value가 0이 아닌게 하나라도 있으면 false를 리턴하면 공간 복잡도를 더 줄일 수 있지 않을까요? :)
Map 대신 길이 28자리 Array로 알파벳의 인덱스에 +,- 를 진행하면 공간을 더 효율화 할 수도 있을것 같아요!
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.
Map을 한 개 사용하거나 Array를 사용하는 법은 생각지 못했는데 감사합니다! 다음에 한 번 더 풀어볼 때는 말해주신 방법으로 공간 복잡도를 줄여볼게요!
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.
BFS사용으로 풀이해 주셨네요! DFS 풀이도 도전해 보시면 좋을것 같습니다 :)
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.
다음에는 DFS로 풀이해보겠습니다~
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.
2주차 문제 풀이 고생하셨습니다.
문제들 모두 정석적으로 잘 풀어주신것 같아서 코드 리뷰 하는 입장에서 너무 편했습니다.
리뷰 반영해서 시간 되실때 한번 더 도전해 보시면 좋을것 같아요.
3주차 문제 풀이도 파이팅입니다!
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!