Skip to content

[clara-shin] WEEK 02 solutions #1259

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

Merged
merged 5 commits into from
Apr 13, 2025
Merged

[clara-shin] WEEK 02 solutions #1259

merged 5 commits into from
Apr 13, 2025

Conversation

clara-shin
Copy link
Contributor

@clara-shin clara-shin commented Apr 11, 2025

답안 제출 문제

작성자 체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@yoouyeon yoouyeon self-requested a review April 11, 2025 13:51
Copy link
Contributor

@yoouyeon yoouyeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 제출 가이드에 PR 제목에 대한 부분이 있어서 확인하고 수정해주시면 좋을 것 같아요~!

문제 푸시느라 고생 많으셨습니다! 아이디어의 흐름을 주석으로 잘 남겨 주셔서 덕분에 풀이 이해하기도 수월했습니다 👍👍👍 남은 문제도 화이팅입니다!!

Comment on lines +24 to +26
// 피보나치 수열 계산을 위한 변수
let first = 1; // f(0) = 1
let second = 1; // f(1) = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 배열을 사용해서 모든 과정에서 나오는 값들을 다 저장했는데 이렇게 변수 2개만 사용하는 방법도 있네요!! 좋은 방법 배워갑니다 👍

Comment on lines +22 to +25
// 길이가 다르면 애너그램이 될 수 없음 (빠른 리턴)
if (s.length !== t.length) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 빠르게 판단 가능한 경우에 바로 리턴해주는 것 좋은 것 같아요 👏

Comment on lines +47 to +51
for (let count of charMap.values()) {
if (count !== 0) {
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동일한 방법이긴 한데 array의 내장 메서드인 every를 사용하는 방법도 있어서 코멘트 남깁니다 😁
기존 코드와 비슷하게 조건에 맞지 않는 요소가 있으면 바로 false를 반환해서 성능적으로도 비슷할 것 같아요..!
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/every

@clara-shin clara-shin moved this from Solving to In Review in 리트코드 스터디 4기 Apr 13, 2025
@clara-shin clara-shin changed the title Valid Anagram solution [clara-shin] WEEK 02 solutions Apr 13, 2025
@clara-shin clara-shin merged commit 378debb into DaleStudy:main Apr 13, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants