Skip to content

Conversation

@lkhyun
Copy link
Contributor

@lkhyun lkhyun commented Oct 14, 2025

🧷 문제 링크

https://school.programmers.co.kr/learn/courses/30/lessons/12973?language=java

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

알파벳 소문자들로 이루어진 문자열에서 같은 문자 2개가 동시에 나타나면 제거한다.
이를 반복진행했을때, 문자열이 사라지면 1, 그렇지 않으면 0을 출력.

🔍 풀이 방법

스택
스택이 비어있거나 peek와 같지 않다면 넣고 아니라면 뺀다.

⏳ 회고

정말 쉬운 문제인데, 문자열을 두개씩 처리하고 같은지 체크하고 다시 문자열만들고 이러다가 시간초과가 났다.
큐나 스택을 쓰는 알고리즘이라는게 바로 떠오르지 않아서 팰린드롬인가? 이런 생각까지 했는데, 어이가 없다.

@lkhyun lkhyun self-assigned this Oct 14, 2025
@lkhyun lkhyun added the hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 label Oct 14, 2025
@ShinHeeEul ShinHeeEul merged commit 65ee2f6 into main Oct 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants