← All problems
Reorder List
Reorder a list L0 -> L1 -> ... -> Ln-1 -> Ln into L0 -> Ln -> L1 -> Ln-1 -> L2 -> Ln-2 -> ... in place, without changing node values. You may not use extra lists proportional to n.
Complexity
Time O(n), Space O(1)
Common pitfalls
- Wrong split point on odd lengths
- Creating a cycle when merging
Your solution
Log in to save your code and track progress.