[dolphinflow86] WEEK 06 Solutions - #2784
Open
dolphinflow86 wants to merge 9 commits into
Open
Conversation
Contributor
📊 dolphinflow86 님의 학습 현황이번 주 제출 문제
누적 학습 요약
문제 풀이 현황
🤖 이 댓글은 GitHub App을 통해 자동으로 작성되었습니다. 🔢 API 사용량 (gpt-5-nano)
|
DaleSeo
approved these changes
Jul 30, 2026
DaleSeo
left a comment
Member
There was a problem hiding this comment.
수고하셨습니다. 취향 문제일 수도 있는 사소한 댓글 하나 남겼어요~
Contributor
There was a problem hiding this comment.
pair 쌍을 dict를 통해 만들어보시는건 어떨까요?
여는 괄호를 key로 하고 닫는 괄호는 value로 하는거죠!
x in dictionary 연산에서 x는 dictionary의 키 중 하나이면 True인것을 이용하면
코드를 매우 간결하게 구현할수 있으실겁니다!
Contributor
Author
There was a problem hiding this comment.
와..생각치 못했는데 코드가 엄청 깔끔해지겠네요.
한번 적용 해 보겠습니다. 👍
Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
| stack = [] | ||
|
|
||
| for ch in s: | ||
| if ch == '(' or ch == '{' or ch == '[': |
Contributor
There was a problem hiding this comment.
이부분을 그러니까 ch in pair 로 대체 가능하세요!
해상 연산은 pair에 ch가 key로 존재하는지 확인하기 때문에 정확히 동일한 연산으로 작동하게 됩니다.
Contributor
Author
There was a problem hiding this comment.
아 제가 아래부분만 바꾸고 여기는 안바꿨군요!
수정 완료했습니다. 훨씬 깔끔해요!
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.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!