Skip to content

11월 4주차 공통 문제#8

Open
KangJiSseok wants to merge 2 commits intomainfrom
4889_안정적인문자열

Hidden character warning

The head ref may contain hidden characters: "4889_\uc548\uc815\uc801\uc778\ubb38\uc790\uc5f4"
Open

11월 4주차 공통 문제#8
KangJiSseok wants to merge 2 commits intomainfrom
4889_안정적인문자열

Conversation

@KangJiSseok
Copy link
Contributor

  1. 불완전한 문자열들만 남도록 했다.
  2. 불완전한 문자열들은 패턴이 존재한다.
  3. 패턴에 따라 완전한문자열이 되도록 개수를 카운트했다.

@0eun2
Copy link
Member

0eun2 commented Dec 1, 2025

나랑 조금 다르게 풀었다. 스택으로 짝이 맞는 쪽은 정리를 하고, 마지막에 스택에 남은 요소들을 2개씩 꺼내면서 괄호를 바꿔야하는 개수를 구한다.
는 스택에는 '{'만 넣고, '}'가 나왔을 때 스택이 비어있으면 개수를 추가하는 방식으로 구현했다.

괄호 처리를 마지막에 하는지 / 바로바로 하는지 방식의 차이가 있어서 참고해보면 좋을 것 같다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants