Create 1021(회전하는큐).java#34
Open
syslians wants to merge 1 commit into
Open
Conversation
1. 현재 target의 인덱스(idx)를 챶움.
2. 왼쪽 회전거리 = idx
오른쪽 회전 거리 = deque.size() - idx
3. 더 짧은 거리로 회전 후 pop
O (N * m) // 제약조건이 N < 50 이므로 충분히 빠름.
Collaborator
|
아 문제 접근 방식 너무 훌륭하네요..... 저도 이런식으로 좀... 적으면서 해야겠어요 |
yu-heejin
approved these changes
Aug 10, 2025
Collaborator
There was a problem hiding this comment.
LinkedList로 dequeue쓸 수 있는거 배우고 가요 ~~
Collaborator
|
우왓! 저랑 똑같은 문제! 저 사실 gpt한데 제일 쉬운 문제 추천해달라고 해서 ㅋㅋㅋㅋ 채찍피티와 함께 풀었씁니다.. |
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.
O (N * m) // 제약조건이 N < 50 이므로 충분히 빠름.