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.
🚀 이슈 번호
Resolve: {#2293}
🧩 문제 해결
스스로 해결: ✅ / ❌
🔎 접근 과정
(처음에는 이동연산 자체를 사분면 번호를 수학적으로 계산해서 하려고 했으나, 복잡해서
단순한 분할정복으로 위치 찾기 + 이동을 동시에 처리하려고 했으나, 이것도 두가지가 복합되어있어서 너무 복잡해서)
쉬운 이동을 위해 가상의 배열 좌표를 두고, 좌표와 사분면 번호를 변환하는 로직을 분할정복으로 처리하고, 이동을 단순히 배열 좌표값을 더하고 빼는 것으로 함.
⏱️ 시간 복잡도
O(N)분할정복의 깊이가 N이기 때문에
💻 구현 코드