Skip to content

[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

Merged
merged 6 commits into from
Apr 26, 2025
Merged

[shinsj4653] Week 04 Solutions #1338

merged 6 commits into from
Apr 26, 2025

Conversation

shinsj4653
Copy link
Contributor

@shinsj4653 shinsj4653 commented Apr 20, 2025

답안 제출 문제

작성자 체크 리스트

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

검토자 체크 리스트

Important

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

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

@shinsj4653 shinsj4653 moved this from Solving to In Review in 리트코드 스터디 4기 Apr 26, 2025
@shinsj4653 shinsj4653 requested a review from Copilot April 26, 2025 14:34
Copy link

@Copilot Copilot AI left a 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:
Copy link
Preview

Copilot AI Apr 26, 2025

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.

Suggested change
class Solution:
class SolutionDFS:

Copilot uses AI. Check for mistakes.

return dfs(root, 1)
# 해설
# bfs 풀이도 존재
class Solution:
Copy link
Preview

Copilot AI Apr 26, 2025

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.

Suggested change
class Solution:
class SolutionBFS:

Copilot uses AI. Check for mistakes.

def coinChange(self, coins: List[int], amount: int) -> int:
memo = {}

def dp(amount):
Copy link
Preview

Copilot AI Apr 26, 2025

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.

Suggested change
def dp(amount):
def dp(amount):
if amount in memo:
return memo[amount]

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

전체적인 문제 풀이에 대한 아이디어, 흐름, 해설을 통한 개선점까지 같이 적어주시는 부분이 굉장히 좋은 것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

풀이에 대해 고민하셨던 부분을 읽어보니 저와 비슷한 고민을 하셨던 것 같아요. 저도 오랫동안 고민하다가 이전 Tree 문제들이 재귀를 이용해 풀이를 진행했던 걸 상기하고 ListNode의 구조를 활용해서 풀이를 했는데, 풀이 과정에 대한 고찰이 꼼꼼하게 적혀있어서 좋았습니다.

Copy link
Contributor

@Tessa1217 Tessa1217 left a comment

Choose a reason for hiding this comment

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

PR 리뷰가 다소 늦어졌네요 ㅠㅠ
전체적으로 문제 풀이에 대한 아이디어, 접근 방식에 대한 고민, 흐름 등이 꼼꼼하게 기재되어 있어서 어떤 방식으로 풀이를 도출해내셨는지 알 수 있어서 좋았습니다.
4주차도 고생하셨습니다. 5주차도 화이팅입니다!

@shinsj4653 shinsj4653 merged commit 4d7221d into DaleStudy:main Apr 26, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 4기 Apr 26, 2025
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