[WEEK09] 추슬기#43
Merged
Merged
Conversation
raejun92
approved these changes
Apr 9, 2026
Comment on lines
+8
to
+14
| for (let i = 0; i < s.length; i++) { | ||
| if (s[i] === "(") { | ||
| stack.push("("); | ||
| } else { | ||
| stack.pop(); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
")"가 먼저 채워지는 조건에서는 얼리 리턴으로 처리해주면 좋을 것 같아요!
LeeBaeJin
approved these changes
Apr 9, 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. 최댓값과 최솟값
1) 복잡도 계산
2) 접근 아이디어
3) 회고
해당 방식이 for문 한번만 돌면 되니 더 풀이가 좋은 것 같다.
2. JadenCase 문자열 만들기
1) 복잡도 계산
2) 접근 아이디어
3) 회고
다들 비슷하게 푼 것 같아서, 따로 회고를 진행하지 않았다.
for문이냐 메서드냐의 차이라 map으로 적용했다.
3. 올바른 괄호
1) 복잡도 계산
2) 접근 아이디어
false, 끝났을 때 0이면 올바른 괄호라고 판단했다.3) 회고
처음에는 바로 스택이 떠올라서 스택으로 풀었는데 괄호 종류가 하나다보니 변수를 하나 선언해서 카운트를 하거나 표기해줘도 괜찮겠다는 생각이 들어 다시 풀어보았다. 배열에 값추가보다는 카운트 방식이 이번 문제에서는 더 적절했을 것 같다.