-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
17-2secondag #75
17-2secondag #75
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deque ๊ฐ ๋ญ์ง? ํ๊ณ ํผ์ ๊ฒ์ํด๋ณธ ๋ค์ PR์ ๋ง์ ์ฝ์๋๋ฐ ๋งจ ์๋ซ๋ถ๋ถ์ ์น์ ํ๊ฒ ์ค๋ช ํด์ฃผ์ จ๋ค์ใ ใ ํ์ ์คํ์ ๋์์ ์ธ ์ ์๋ ๊ธฐ๋ฅ์ด๋ผ๋ ํธํ๋ค..!!
์ด๋ฒ ์คํฐ๋๋์ ์ด์๋ PR์ ๋ณผ ๋ ๋ง๋ค ํํํจ๊ณผ ๊ฐํ์ ์ฐ์์ด์๋ ๊ฒ ๊ฐ์์. ๋ฌธ์ ๋ฅผ ๋ณด๋ ์๊ฐ ๋ก์ง์ ๋ ์ฌ๋ ธ์ง๋ง, '์ด๊ฑฐ ์ผ์ผํ ๊ตฌํํ๋ ค๋ฉด ์ข ๊ท์ฐฎ๊ฒ ๋๋ฐ?' ๋ผ๊ณ ์๊ฐํ ์ ์ด ๋ง์๋ฐ, ํ์ด์ฌ์ ํ ์ค, ํจ์ ํ๋๋ก ํด๊ฒฐ๋๋ ๊ฒฝ์ฐ๊ฐ ๋๋ฌด ๋ง์์...ใ ใ ์ํ์ ํ(์ด์ฌ)ํ๊ฐ.. ์ด๋๊น์... ใ ใ ใ ใ ใ ใ ใ ใ ใ ใ ๋ ๋ฌ ๋์ ๊ณ ์ ๋ง์ผ์ จ์ต๋๋ค! ๐ฅฐ๐ฅฐ
|
||
while len(dq) > 1: | ||
dq.popleft() | ||
dq.rotate(-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค๋ก ๋ณด๋ด๋ ๊ฑธ ์ด๋ป๊ฒ ํ๋ ค๋.. ํ๋๋ฐ ๊ทธ๋ฅ ํจ์๋ก ๋๋๋ค์? ์ ๋ ๋ค์ ๋ฐฉํ์๋ ํ์ด์ฌ์ ๋ฐฐ์๋ด์ผ ํ๋ ์ถ๋ค์...ใ ใ ใ ใ ใ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋๋๊ฒ๋ deque ๊ถ์คํ ๊ต์๋ ์๋ฃ๊ตฌ์กฐ ์๊ฐ์ ๋ฐฐ์๋ต๋๋ค ํํ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotate๋ ์ง์ง ์ ๊ธฐํ๋ค์
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ง์ง๋ง PR ๊ณ ์ํ์
จ์ต๋๋ค~~~~~
dequeue๋ฅผ ์ฌ์ฉํ์ ๋, ์ ๋ ๋งจ ๋ค๋ก ๋ณด๋ด๋ ๊ฑธ pop()ํ ๋ค ๋ค์ push()ํ๋ ๊ฑธ๋ก ์๊ฐํ๋๋ฐ, rotate๋ ํจ์๊ฐ ์์๊ตฐ์... ํ์ด์ฌ ๋๋จ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2๋ฌ๋์ ๊ณ ์ํ์ ง์ต๋๋ค..ํํ
์๋ก์ด ๋ฌธ์ ์ ํ์ด๋ ์๋ฃ๊ตฌ์กฐ๋ ๋ฐฐ์ ๋ dfs๋ bfs ๋ฅผ ํ์ผ๋ฉด ์ข์์ ํ
๋ฐ ์์ฌ์ด ๋ง์์ด ์ข ๋ ํฐ ๊ฒ ๊ฐ์ต๋๋ค
์ฌํํผ ๊ณ ์ํ๊ณ ํ๊ต์์ ๋ด
์๋น ์์ ๋งค์ผ ํ๊ต ๊ฐ๋์ค.,,,
|
||
while len(dq) > 1: | ||
dq.popleft() | ||
dq.rotate(-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotate๋ ์ง์ง ์ ๊ธฐํ๋ค์
๐ ๋ฌธ์ ๋งํฌ
์นด๋2
โ๏ธ ์์๋ ์๊ฐ
30๋ถ
โจ ์๋ ์ฝ๋
๋ฌธ์ ์ค๋ช
์ฝ๊ฒ ๊ทธ๋ฆผ์ผ๋ก ํํํ์๋ฉด
์ฝ๋ ์ค๋ช
+ ๋งจ ์์์ ํ ๋ช ์ ์ ๊ฑฐ
+ ํ ์นธ์ฉ ์ผ์ชฝ์ผ๋ก ํ์ (๋งจ ์์ ๊ฐ์ ๋งจ ๋ค๋ก ๋ณด๋)
์ ์ฒด ์ฝ๋
๐ ์๋กญ๊ฒ ์๊ฒ๋ ๋ด์ฉ
deque
Deque
๋ฆฌ์คํธ์ ์์ชฝ ๋์์ ์ฝ์ ๊ณผ ์ญ์ ๋ฅผ ๋ชจ๋ ํ์ฉํ๋ ์๋ฃ
์ฝ๋์์ ์ฌ์ฉํ ๋ช ๋ น์ด
๋ ๋ฌ๋์ ์๊ณ ๋ง์ผ์ จ์ต๋๋น~~~!!!!!!!!
๋ค์ ๋ฐฉํ ๋ ๋ดฌ์ฉ