-
Notifications
You must be signed in to change notification settings - Fork 7
[citrussoda] 24.11.26 #106
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
Conversation
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
JooKangsan
pushed a commit
that referenced
this pull request
Dec 3, 2024
* 56 / Merge Intervals / Medium / 22m 31s * 1584 / Min Cost to Connect All Points / Medium / >25m * 235 / Lowest Common Ancestor of a Binary Search Tree / Medium / 13m 12s * 139 / Word Break / Medium / 23m 19s * 215 / Kth Largest Element in an Array / Medium / 2m
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.
📌 푼 문제
📝 간단한 풀이 과정
56. Merge Intervals
prev라는 배열 하나를 이용하여 겹쳐지면 push하여 추가하는 방식으로 구현하였습니다.
1584. Min Cost to Connect all points
프림 알고리즘을 알고있는지 물어보는 문제였습니다.
노드를 천천히 최소 거리로 잇고 거리를 구하는 로직입니다.
235. Lowest Common ancestor of a Binary Search Tree
알고리즘을 만드는 문제라기 보단 LCA를 이해하고 있나 물어보는 문제인 것 같았습니다.
이진트리라는 점을 이용하여 왼쪽에는 더 작은 노드, 오른쪽은 더 큰 노드이므로 루트노드가 p보다 크고 q보다 작을때 return시키면 되므로 재귀로 위에서부터 아래로 찾아가는 알고리즘입니다.
139. Word Break
dp를 이용하여 단어가 잘라내지면 dp내를 true로 바꾸어 단어가 wordDict의 배열로 분리되는지 확인하였습니다.
150. Kth largest element in an Array
여러 로직을 사용하기 위해 Medium인지는 모르겠으나 그냥 sort후 -1만 접근해도 충분히 빨라 구현했습니다.