-
Notifications
You must be signed in to change notification settings - Fork 7
[Berrnuda] 24.11.26 #105
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
[Berrnuda] 24.11.26 #105
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
* 150 / Evaluate Reverse Polish Notation / Meium / 12m 01s * 56 / Merge Intervals / Medium / 12m 58s * 235 / Lowest Common Ancestor of a Binary Search Tree / Medium / 14m 45s * 139 / Word Break / Medium / 18m 22s * 215 / Kth Largest Element in an Array / Medium / 20m 19s
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
n번째의 end가 n+1번째의 start보다 크면 합치는식으로 코드를 작성했습니다.
cur[1]은 현재 값의 end 값을 나타내고intervals[i]의 시작값과 비교합니다.겹치면 cur에 머지를하고 겹치지않으면 result 배열에 추가합니다.
235 Lowest Common ancestor of a Binary Search Tree
매주 지날때마다 문제 이해하는데에만 5분정도 쓰는거같아요 ㅠ
재귀함수로 작성해야되나 싶었는데 그럴 필요가 없는거같아서 반복문으로 작성했습니다.
p,q의 값을 최상위 노드부터 비교해가며 확인해 나가는 코드입니다.
139 Word Break
dp[i]는s[0:i]의 값을 저장하는 배열입니다.i >= word.length: 단어를 비교할 길이가 충분해야하고dp[i - word.length]: 이전 상태가 분할 가능해야하고s.slice(i - word.length, i) === word: 단어가 맞는지 확인하는 반복문을 거칩니다.215 Kth largest element in an Array
저번에 못썼던
MinPriorityQueue을 써봤습니다leetcode 내에서 언어 옆에 느낌표를 눌러보면 어떤 라이브러리들이 내장되어있는지 나오는데 datastructures에 내장되어있는 함수인거같아요
최소 힙을 이용해서 푼 문제로 k만큼의 사이즈만 남겨두고 k번째로 큰 값을 출력하는 코드입니다.
🙌 궁금한 점