Conversation
- 이차원 배열의 테두리를 미리 ' '로 채워줌 - 지게차로 꺼내는 경우 - 0, 0 -> ' ' 외곽 좌표부터 ' '이면 bfs로 탐색 - 탐색 도중에 외부와 연결된 알파벳을 찾으면 delQ에 담아줌 - bfs가 끝나고나면 delQ에 있는 알파벳을 꺼내줌 - 크레인으로 꺼내는 경우 - full scan해서 직접 꺼냄
- 문제에 나온대로 구현하면 더 간단함 - idx와 같으면 cnt++; - 다르면 st.push(); - while (q.top == idx) - q.pop(); - cnt++; - 모두 읽은 후 - !st.empty() -> 실패
- map을 이용해서 풀이를 했는데 찾아보니 투 포인터로도 풀이가 가능한 문제였습니다! - 원본 배열을 정렬하고, 투 포인터로 원소를 하나씩 탐색하면서 i(본인)은 건너뛰고 a[i]가 존재한다면 ++하는 식으로 구현 가능
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.
❤️ 도키도키 간식드리미
윈소와 번호(idx)가 일치하면 바로 나갈 번호(idx)를 증가시키는 식으로 구현함
다 뺀 후 idx가 N + 1이 되지 않았으면 스택에 이상한 번호가 있는 것이므로 "Sad"를 출력하고, 아니면 "Nice"를 출력
🏢 회사 문화 1
자율 문제
추가