143. Reorder List
Last updated
Last updated
You are given the head of a singly linked-list. The list can be represented as:
Reorder the list to be on the following form:
You may not modify the values in the list's nodes. Only nodes themselves may be changed.
Example 1:
Example 2:
Constraints:
The number of nodes in the list is in the range [1, 5 * 104]
.
1 <= Node.val <= 1000