Skip to content

Create 1021(회전하는큐).java#34

Open
syslians wants to merge 1 commit into
syslian_simutlationfrom
syslians-patch-2
Open

Create 1021(회전하는큐).java#34
syslians wants to merge 1 commit into
syslian_simutlationfrom
syslians-patch-2

Conversation

@syslians

Copy link
Copy Markdown
Owner
  1. 현재 target의 인덱스(idx)를 챶움.
  2. 왼쪽 회전거리 = idx 오른쪽 회전 거리 = deque.size() - idx
  3. 더 짧은 거리로 회전 후 pop

O (N * m) // 제약조건이 N < 50 이므로 충분히 빠름.

1. 현재 target의 인덱스(idx)를 챶움.
2. 왼쪽 회전거리 = idx
    오른쪽 회전 거리 = deque.size() - idx
3. 더 짧은 거리로 회전 후 pop

O (N * m) // 제약조건이 N < 50 이므로 충분히 빠름.
@zinzoddari

Copy link
Copy Markdown
Collaborator

아 문제 접근 방식 너무 훌륭하네요.....

저도 이런식으로 좀... 적으면서 해야겠어요

@yu-heejin yu-heejin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최고의 코드!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LinkedList로 dequeue쓸 수 있는거 배우고 가요 ~~

@lyg9088

lyg9088 commented Aug 10, 2025

Copy link
Copy Markdown
Collaborator

우왓! 저랑 똑같은 문제! 저 사실 gpt한데 제일 쉬운 문제 추천해달라고 해서 ㅋㅋㅋㅋ 채찍피티와 함께 풀었씁니다..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants