-
-
Notifications
You must be signed in to change notification settings - Fork 195
[shinsj4653] Week 04 Solutions #1338
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
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.
Pull Request Overview
This PR submits solutions for multiple algorithm problems from week 04. The changes include implementations for word search, merging two sorted linked lists, determining maximum depth of a binary tree, and a coin change solution; the rotated sorted array file currently contains only the problem discussion without an implementation.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
word-search/shinsj4653.py | Contains two implementations for the word search problem (duplicate definitions and variable naming opportunities). |
merge-two-sorted-lists/shinsj4653.py | Implements merging of two sorted linked lists. |
maximum-depth-of-binary-tree/shinsj4653.py | Provides DFS and BFS solutions for computing tree depth (appears to have duplicate class definitions). |
find-minimum-in-rotated-sorted-array/shinsj4653.py | Only contains problem context; implementation is missing. |
coin-change/shinsj4653.py | Uses a top-down DP approach for coin change with room for caching improvements. |
Comments suppressed due to low confidence (2)
word-search/shinsj4653.py:89
- [nitpick] Consider renaming the variable 'v' to 'visited' to improve code clarity.
v = [[False for _ in range(m)] for _ in range(n)]
find-minimum-in-rotated-sorted-array/shinsj4653.py:14
- The solution implementation is missing; please add the function to find the minimum in the rotated sorted array.
'''
# exist([["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], "ABCCDE") | ||
|
||
|
||
class Solution: |
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.
Multiple definitions of 'Solution' detected. Consider consolidating them into a single class or renaming one to prevent unintended overrides.
class Solution: | |
class SolutionDFS: |
Copilot uses AI. Check for mistakes.
return dfs(root, 1) | ||
# 해설 | ||
# bfs 풀이도 존재 | ||
class Solution: |
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.
Duplicate 'Solution' class definition may cause unintended overrides. Consider merging the two implementations or renaming one of them.
class Solution: | |
class SolutionBFS: |
Copilot uses AI. Check for mistakes.
def coinChange(self, coins: List[int], amount: int) -> int: | ||
memo = {} | ||
|
||
def dp(amount): |
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.
Consider caching the result of dp(amount) by storing it in memo after computation to avoid repeated calculations and improve performance.
def dp(amount): | |
def dp(amount): | |
if amount in memo: | |
return memo[amount] |
Copilot uses AI. Check for mistakes.
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.
풀이에 대해 고민하셨던 부분을 읽어보니 저와 비슷한 고민을 하셨던 것 같아요. 저도 오랫동안 고민하다가 이전 Tree 문제들이 재귀를 이용해 풀이를 진행했던 걸 상기하고 ListNode의 구조를 활용해서 풀이를 했는데, 풀이 과정에 대한 고찰이 꼼꼼하게 적혀있어서 좋았습니다.
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.
PR 리뷰가 다소 늦어졌네요 ㅠㅠ
전체적으로 문제 풀이에 대한 아이디어, 접근 방식에 대한 고민, 흐름 등이 꼼꼼하게 기재되어 있어서 어떤 방식으로 풀이를 도출해내셨는지 알 수 있어서 좋았습니다.
4주차도 고생하셨습니다. 5주차도 화이팅입니다!
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!