You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
좋은 진행이고 여러 문제에 대해 깔끔한 솔루션을 제출하셨네요! 아래 피드백은 학습과 개선에 도움이 되도록 정리했습니다.
시간/공간 복잡도 분석: 각 문제별로 TC와 SC를 명확히 표기하는 것을 추천드립니다. 예를 들어, findMin은 정렬을 사용하므로 TC: O(n log n), SC: O(1) 또는 O(n) (정렬 구현에 따라 다름), maxDepth는 DFS 기반으로 TC: O(n), SC: O(h) (트리 높이)입니다. 명확히 표기하면 가독성과 이해가 좋아집니다.
findMin의 접근법: 현재 Arrays.sort()를 사용했는데, 이는 정렬이 필요없고, 문제의 목적은 최소값 찾기입니다. 회전된 배열에서는 이진 탐색으로 최소값을 찾는 방법이 더 효율적입니다. 이진 탐색을 활용하면 시간복잡도를 O(log n)으로 줄일 수 있어 더 나은 솔루션입니다. 참고해서 개선해보세요!
가독성 및 스타일: 전반적으로 깔끔하나, mergeTwoLists에서 새 노드를 매번 생성하는 대신에 기존 노드를 연결하는 방식도 고려해보세요. 이렇게 하면 불필요한 노드 생성을 줄일 수 있어 메모리 효율이 좋아집니다.
maxDepth 구현: 재귀 호출이 깔끔하며, 변수 이름도 명확합니다. 다만, depth 파라미터를 처음에 0으로 시작하는 대신 1로 시작하면, 더 직관적일 수 있습니다. 또는, solve 대신 dfs라는 이름도 고려하세요.
word-search 문제: DFS 탐색이 적절하며, 방문 체크를 map[x][y] = '#'로 하는 방식도 좋습니다. 다만, result를 static 변수로 두기보다, 함수 반환값으로 처리하거나, 백트래킹에서 즉시 반환하는 구조로 개선하면 더 깔끔할 수 있습니다.
전반적으로 훌륭한 작업입니다! 더 효율적이거나 깔끔한 방법들이 있으니 도전해보시고, 계속 발전하는 모습 기대할게요. 계속해서 연습하며 성장하시길 응원합니다!
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
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 하나 이상을 반드시 검토를 해주셔야 합니다!