Conversation
doitchuu
previously approved these changes
Feb 13, 2026
Member
doitchuu
left a comment
There was a problem hiding this comment.
고생하셨습니다 👍 좋은 풀이가 많네요
PR 템플릿이랑 파일명만 수정 부탁드려요
| } | ||
|
|
||
| return value; | ||
| }; |
Member
There was a problem hiding this comment.
파일명은 BestTimeToBuyAndSellStock.js 등 카멜 케이스로 작성 부탁드립니다!
| return [newNums[start][1], newNums[end][1]]; | ||
| } | ||
| } | ||
| }; No newline at end of file |
Member
There was a problem hiding this comment.
이중 for문으로 해결하는 방식만 생각했었는데, 포인터를 시작점과 끝점을 두고 한번에 구현하는 방식이 더 좋네요 👍
| } | ||
|
|
||
| return stack.length === 0; | ||
| }; |
sik9252
reviewed
Feb 13, 2026
| * @return {number[]} | ||
| */ | ||
| var twoSum = function(nums, target) { | ||
| const newNums = nums.map((v, i) => [v, i]).sort((a, b) => a[0] - b[0]); |
Collaborator
There was a problem hiding this comment.
저는 알고리즘 할 때 저렇게 자바스크립트만의 고차함수(?)를 잘 활용 못하겠던데 잘 쓰시네요 허허
그리고 투 포인터라니 그걸 여기서 떠올리셨다는 점 ... 존경합니다
Comment on lines
+13
to
+15
| if (s[i] === ')' && top === '(') continue; | ||
| if (s[i] === ']' && top === '[') continue; | ||
| if (s[i] === '}' && top === '{') continue; |
Collaborator
There was a problem hiding this comment.
continue로 흐름제어한거 좋은 것 같아요
|
|
||
| for (let i = 0; i < prices.length; i++) { | ||
| const min = prices[i]; | ||
| const max = Math.max(...prices.slice(i + 1)); |
Collaborator
There was a problem hiding this comment.
엣지케이스를 하나 찾아봤어요, prices = [1] 처럼 길이가 1이면 Math.max(...prices.slice(0+1))이 되어 값이 -Infinity가 출력될 수 있을 것 같아요!
sik9252
previously approved these changes
Feb 13, 2026
doitchuu
approved these changes
Feb 15, 2026
sik9252
approved these changes
Feb 19, 2026
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
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.
이렇게 풀었어요
1. TwoSum
1) 복잡도 계산
2) 접근 아이디어
3) 회고
2. Valid Parentheses
1) 복잡도 계산
2) 접근 아이디어
3) 회고
3. Merge Two Sorted Lists
1) 복잡도 계산
2) 접근 아이디어
3) 회고
4. Best Time to Buy and Sell Stock
1) 복잡도 계산
2) 접근 아이디어
3) 회고