Skip to content

[dahyeong-yun] WEEK 06 Solutions - #2783

Open
dahyeong-yun wants to merge 6 commits into
DaleStudy:mainfrom
dahyeong-yun:week06
Open

[dahyeong-yun] WEEK 06 Solutions#2783
dahyeong-yun wants to merge 6 commits into
DaleStudy:mainfrom
dahyeong-yun:week06

Conversation

@dahyeong-yun

@dahyeong-yun dahyeong-yun commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@dalestudy

dalestudy Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

📊 dahyeong-yun 님의 학습 현황

이번 주 제출 문제

문제 난이도 유형 분석
container-with-most-water Medium ✅ 의도한 유형
longest-increasing-subsequence Medium ✅ 의도한 유형
spiral-matrix Medium ✅ 의도한 유형
valid-parentheses Easy ✅ 의도한 유형

누적 학습 요약

  • 풀이한 문제: 23 / 75개
  • 이번 주 유형 일치율: 100% (4문제 중 4문제 일치)

문제 풀이 현황

카테고리 진행도 완료
Array ■■■■■□□ 7 / 10 (Medium 4, Easy 3)
Dynamic Programming ■■■■□□□ 6 / 11 (Easy 1, Medium 5)
Heap ■■□□□□□ 1 / 3 (Medium 1)
String ■■□□□□□ 3 / 10 (Medium 1, Easy 2)
Matrix ■■□□□□□ 1 / 4 (Medium 1)
Binary ■□□□□□□ 1 / 5 (Easy 1)
Linked List ■□□□□□□ 1 / 6 (Easy 1)
Tree ■□□□□□□ 2 / 14 (Easy 1, Medium 1)
Graph ■□□□□□□ 1 / 8 (Medium 1)
Interval □□□□□□□ 0 / 5 ← 아직 시작 안 함

🤖 이 댓글은 GitHub App을 통해 자동으로 작성되었습니다.

🔢 API 사용량 (gpt-5-nano)
요청 입력 토큰 출력 토큰 합계 비용
1 701 37 738 $0.000050
2 476 37 513 $0.000039
3 2,048 166 2,214 $0.000169
합계 3,225 240 3,465 $0.000257

@github-actions github-actions Bot added the java label Jul 29, 2026
@dolphinflow86
dolphinflow86 self-requested a review July 30, 2026 00:05
stack.push(c);
} else {
// 닫는 괄호의 경우 stack이 비어있으면 안됨
if(stack.size() < 1) return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사소하지만, stack에 isEmtpy()가 있다면 사용하시면 좀 더 가독성이 좋을 것 같아요.

Comment on lines +23 to +25
if((peek == '(' && c == ')')
|| (peek == '{' && c == '}')
|| (peek == '[' && c == ']')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 리뷰 받은 사항인데, map에 key, value로 여는괄호 닫는괄호 쌍을 넣어두고 체크하면 코드가 매우 깔끔해질 것 같습니다.

public boolean isValid(String s) {
Deque<Character> stack = new ArrayDeque<>();

for(char c : s.toCharArray()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

찾아보니 toCharArray가 내부적으로 문자열을 복제헤서 새로 만든다고 하네요.
인덱스 접근으로 s.chatAt(i) 처럼 하시면 불필요한 연산을 줄이실 수 있을 것 같습니다.

@dahyeong-yun dahyeong-yun moved this from Solving to In Review in 리트코드 스터디 8기 Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants