-
-
Notifications
You must be signed in to change notification settings - Fork 195
[JustHm] Week 02 solutions #1205
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
|
||
return charCount | ||
} | ||
} |
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.
저는 Swift 언어를 다룬 적이 없지만, 세가지 방법으로 구현하신 것 같습니다.
- Dictionary 를 이용하여 문자별로 count 를 세고, 체크 (없으면 False, 있으면 감소 시키고, 최종 empty 인지 체크)
- sort 를 이용하여 같은지 비교
- Counter 구현 (Char key 가 아닌 26 size 의 integer 배열 이용)
다양한 방법으로 구현하신 것을 보고, python 의 Counter 를 이용해서 딸랑 한개의 메소드만을 구현한 제 자신을 반성하게 되었습니다. 😭
속도와 구현 난이도를 구별해주신 부분도 좋았습니다.
다만, 속도 비교의 경우 알고리즘에서는 Big O 표기법이 표준(?) 으로 인식 되는 만큼 Big O 표기법을 이용해서 시간/공간 복잡도를 작성(노트)해보신다면, 추후 인터뷰에 도움이 될 것 같다는 생각을 해봅니다.
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.
Swift Code 는 잘 모르지만 pseudocode 처럼 생각하고 리뷰를 진행해봤습니다.
전반적으로 제가 작성한 알고리즘과 비슷한데, 몇몇 문법들은 더 직관적으로 보이네요.
3Sum 코드가 안 보이는데, 3Sum 코드 올라오면 추가로 확인해보겠습니다.
우선 Approve 처리 하겠습니다.
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!