Conversation
Approving was a mistake; I miss-clicked.
Cyjin-jani
approved these changes
Mar 31, 2026
Contributor
Cyjin-jani
left a comment
There was a problem hiding this comment.
5주차도 고생 많으셨습니다!
rust 코드는 처음 봐서 AI와 리뷰를 해보았는데, rust에 흥미가 조금 생겼습니다 😄
| for b in s.bytes() { | ||
| count[(b - b'a') as usize] += 1; | ||
| } | ||
| anagrams.entry(count).or_default().push(s); |
Contributor
There was a problem hiding this comment.
rust를 아예 몰라서, AI의 도움을 받아서 리뷰를 해보았습니다만.. 위 코드는 js에서 두줄로 써야 하는 코드군요..!
// js라면...
if (!map.has(key)) map.set(key, []);
map.get(key).push(str);
한줄로 깔끔하게 작성되는 걸 보니 rust에 흥미가 생겼습니다..ㅎㅎ
Member
Author
There was a problem hiding this comment.
하하, 이 참에 Rust 함께 배우시죠? ㅋㅋ
| pub fn group_anagrams(strs: Vec<String>) -> Vec<Vec<String>> { | ||
| let mut anagrams: HashMap<[u8; 26], Vec<String>> = HashMap::new(); | ||
| for s in strs { | ||
| let mut count = [0u8; 26]; |
Contributor
There was a problem hiding this comment.
문자 빈도수 배열로 카운팅을 하신 풀이가 좋았습니다..! 좋은 아이디어 배워갑니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!