[dolphinflow86] WEEK 02 Solutions#2677
Open
dolphinflow86 wants to merge 4 commits into
Open
Conversation
Contributor
📊 dolphinflow86 님의 학습 현황이번 주 제출 문제
누적 학습 요약
문제 풀이 현황
🤖 이 댓글은 GitHub App을 통해 자동으로 작성되었습니다. 🔢 API 사용량 (gpt-5-nano)
|
Contributor
There was a problem hiding this comment.
🏷️ 알고리즘 패턴 분석
- 패턴: Dynamic Programming, Hash Map / Hash Set, Backtracking
- 설명: 재귀와 메모이제이션으로 중복 계산을 줄여 문제를 풀이하며, 결과를 저장하는 해시 맵을 사용한다. 부분 해를 합쳐 전체 해를 구하는 DP 스타일 접근으로 패턴에 부합하고, 탐색 과정에서 상태를 저장한다.
📊 시간/공간 복잡도 분석
ℹ️ 이 파일에는 4가지 풀이가 포함되어 있어 각각 분석합니다.
풀이 1: Solution.climbStairs — Time: O(n) / Space: O(n)
| 복잡도 | |
|---|---|
| Time | O(n) |
| Space | O(n) |
피드백: 메모화를 사용해 중복 계산을 피하고 재귀 깊이는 n까지 증가한다.
개선 제안: 현재 구현이 적절해 보입니다.
풀이 2: Solution.productExceptSelf — Time: O(n) / Space: O(1)
| 복잡도 | |
|---|---|
| Time | O(n) |
| Space | O(1) |
피드백: 왼쪽/오른쪽 누적곱을 순회하며 결과 배열에 누적한다.
개선 제안: 현재 구현이 적절해 보입니다.
풀이 3: Solution.isAnagram (전 첫 구현) — Time: ❌ O(N) → O(n log n) / Space: ✅ O(N) → O(n)
| 유저 분석 | 실제 분석 | 결과 | |
|---|---|---|---|
| Time | O(N) | O(n log n) | ❌ |
| Space | O(N) | O(n) | ✅ |
피드백: 정렬에 의한 시간 복잡도 증가가 존재한다.
개선 제안: 필요 시 카운트(Hashmap) 기반으로 평균 O(n) 가능.
풀이 4: Solution.isAnagram (두 번째 구현) — Time: O(n) / Space: O(k)
| 복잡도 | |
|---|---|
| Time | O(n) |
| Space | O(k) |
피드백: 해시맵으로 선형 시간에 해결 가능하다.
개선 제안: 현재 구현이 적절해 보입니다.
💡 풀이에 시간/공간 복잡도를 주석으로 남겨보세요!
Contributor
There was a problem hiding this comment.
🏷️ 알고리즘 패턴 분석
- 패턴: Two Pointers, Greedy, Hash Map / Hash Set, Dynamic Programming, Divide and Conquer, Bit Manipulation, Binary Search, Monotonic Stack, Trie, Union Find, BFS, DFS, Backtracking, Heap / Priority Queue
- 설명: 이 코드는 왼쪽 곱과 오른쪽 곱을 미리 계산해 전체 곱을 구하는 방식으로 단일 패스가 아닌 두 패스를 이용하는 포맷이며, 추가로 곱셈의 중간값을 유지하면서 결과를 갱신한다. 두 포인터 스타일의 순회와 누적 값을 활용하는 패턴으로 간주될 수 있다.
Contributor
There was a problem hiding this comment.
🏷️ 알고리즘 패턴 분석
- 패턴: Hash Map / Hash Set, Sort or Count
- 설명: 주어진 코드에서 두 문자열의 요소를 비교하기 위해 해시 맵으로 문자 등장 횟수를 세고 감소시키는 방식(H using Hash Map)과 정렬 후 비교하는 방식(정렬 기반 비교)이 사용됩니다. 패턴 목록에는 Hash Map / Hash Set이 명시되어 있고, 정렬 기반 접근은 패턴 목록의 정확한 항목에 부합하는 명칭이 없어 포함 여부를 판단해야 할 경우 Hash Map 패턴으로 주로 설명합니다.
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 하나 이상을 반드시 검토를 해주셔야 합니다!