Skip to content

Leetcode reorder list#22

Open
Igneaalis wants to merge 11 commits intomasterfrom
LEETCODE-reorder-list
Open

Leetcode reorder list#22
Igneaalis wants to merge 11 commits intomasterfrom
LEETCODE-reorder-list

Conversation

@Igneaalis
Copy link
Copy Markdown
Owner

Added LEETCODE "reorder-list" deque solution.

@Igneaalis Igneaalis requested a review from Vivelapaix June 4, 2020 22:12
@@ -0,0 +1,32 @@
# Linked list

+ [Reorder List (deque)](#reorder-list-deque)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Screenshot from 2020-06-05 01-42-18

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Кого ты пытаешься удивить своим кодом? Ты написал простейшую задачу через какие-то сложности

Разбил список пополам, вторую половину развернул и слил в один список, все

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Если нечёт, то делаем popleft, а если чёт, то просто pop. if i&1 та же проверка на нечётность, только короче. PEP8 щас поправлю.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Не устраивает, решение сложное, надо упростить

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@Vivelapaix двусвязные списки так и просят использовать deque :), но попробую по-другому решить.

@Igneaalis Igneaalis added the tbd Solution was provided but another was requested. label Jun 5, 2020
@Igneaalis Igneaalis requested review from Vivelapaix and removed request for Vivelapaix June 5, 2020 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tbd Solution was provided but another was requested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants