Back to DSA sheet

Reorder List

MediumLinked List
Open on LeetCodeAmazonGoogle

Reorder a list L0->L1->...->Ln to L0->Ln->L1->Ln-1->... by rearranging nodes in place.

Constraints
  • 1 <= size <= 5 * 10^4
  • 1 <= Node.val <= 1000
Sheets
Blind 75NeetCode 150NeetCode 250
reorder-list.cpp
Loading editor
Custom input (stdin)
Output

Run your code to see its output.