← All problems

Reorder List

Medium linked liststwo-pointers LeetCode ↗
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.

Hints (0/3 revealed)

Log in to reveal hints progressively.

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.