Skip to content

[doitduri] Week 05 Solution #1410

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 4 commits into from
May 3, 2025
Merged

[doitduri] Week 05 Solution #1410

merged 4 commits into from
May 3, 2025

Conversation

doitduri
Copy link
Contributor

@doitduri doitduri commented May 3, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@JANGSEYEONG JANGSEYEONG requested review from JANGSEYEONG and removed request for JANGSEYEONG May 3, 2025 07:14
}

var result = 0
for price in prices {
Copy link
Contributor

Choose a reason for hiding this comment

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

약간의 최적화를 위해 for price in prices[1...]와 같은 구문을 사용하여 이미 anchor로 설정한 첫 번째 요소를 다시 확인하지 않아도 좋을 것 같습니다!

그 외에는 로직이 명확하고 시간복잡도 O(n)과 공간복잡도 O(1)로 효율적인 접근법으로 보입니다 👍

@@ -0,0 +1,16 @@
class Solution {
func groupAnagrams(_ strs: [String]) -> [[String]] {
Copy link
Contributor

Choose a reason for hiding this comment

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

애너그램 문제를 효율적으로 해결했고, 딕셔너리와 옵셔널 체이닝을 활용해서 깔끔하게 작성하신 것 같습니다. 정렬 방식으로 애너그램을 찾는 접근법도 명확하고 직관적인 것 같아요 👍

@doitduri doitduri moved this from Solving to Completed in 리트코드 스터디 4기 May 3, 2025
@doitduri doitduri merged commit 3ea621b into DaleStudy:main May 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants