Skip to content

Conversation

@rlawngP91
Copy link
Collaborator

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

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

회전을 pop()을 이용해서도 구현이 가능하겠군요! 자료구조를 잘 써야하는 문제였던거 같아요 ..

Copy link
Collaborator

Choose a reason for hiding this comment

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

파이썬에서는 list.insert(0)의 경우 O(N)이 소요됩니다. 앞과 뒤에 append를 빠르게 (O(1))할 수 있는 collections.deque를 활용하면 될 것 같아요! deque.rotate()를 통해서 회전도 가능하다는 장점이 많습니다.
from collections import deque

Copy link
Collaborator

Choose a reason for hiding this comment

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

저는 이 조건을 아예 while문 조건에 추가했습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

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

벨트 / 로봇이 벨트 어디에 존재하는지 이 둘의 구조를 따로 관리한 점은 저랑 같습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

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

저는 numpy를 코딩 테스트에 써본 적이 없었는데 파이썬인 만큼 이런 라이브러리 활용을 잘해야 되겠다고 느꼈습니다..

Copy link
Collaborator

Choose a reason for hiding this comment

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

회전하는 함수가 numpy에 존재하는지 몰랐습니다...

Copy link
Collaborator

Choose a reason for hiding this comment

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

pad를 하게되면 어떻게 lock이 변화하나요 ?

Copy link
Collaborator

@donghoony donghoony left a comment

Choose a reason for hiding this comment

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

몇가지 개선할 수 있는 사항들을 리뷰해드립니다. 고생하셨어요!

Copy link
Collaborator

Choose a reason for hiding this comment

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

파이썬에서는 list.insert(0)의 경우 O(N)이 소요됩니다. 앞과 뒤에 append를 빠르게 (O(1))할 수 있는 collections.deque를 활용하면 될 것 같아요! deque.rotate()를 통해서 회전도 가능하다는 장점이 많습니다.
from collections import deque

Copy link
Collaborator

Choose a reason for hiding this comment

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

로봇이 N에서 내린다는 점을 감안해서 뒤쪽부터 봐주면 되는 관찰이 이번 문제의 핵심이었던 것 같습니다 💯

Copy link
Collaborator

Choose a reason for hiding this comment

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

제한이 작아서 괜찮지만, 매번 count를 하는 것도 O(N)으로 큰 제한에서는 부담이 될 수 있습니다. 따로 내구도가 0이 될 때마다 카운트하는 변수를 만들면 부하를 줄일 수 있겠네요!

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.

3 participants