Skip to content

Conversation

@lkhyun
Copy link
Contributor

@lkhyun lkhyun commented Aug 30, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/16472

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

고냥이는 최대 N개의 문자 종류만 알아들을 수 있음. 이때 문자열 중에서 알아들을 수 있는 최대 문자열 길이를 출력

🔍 풀이 방법

투 포인터
left right 두 개의 포인터로 쭉 오른쪽으로 이동하면서 map을 통해 현재 문자 종류가 N을 넘어가지 않게끔 쭉 확인함.

⏳ 회고

반복문에서 현재 문자 종류가 N보다 작아야 받을 수 있게끔 했었는데 생각해보면 N개가 충족됐더라도 이미 있는 단어가 들어오는 경우에는 받을 수 있게 했어야 했다. 바로 생각을 못했던게 아쉽다.

@lkhyun lkhyun self-assigned this Aug 30, 2025
@lkhyun lkhyun added the success 👍 해설을 보지 않고 풀었을 때 label Aug 30, 2025
@ShinHeeEul ShinHeeEul merged commit b3b6e86 into main Aug 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants