As reported: Expedia SDE-2 round 1 DSA (Bangalore, 2025): Reorder Linked List — find the middle, reverse the second half, merge — with edge cases and testing discussed.
Given the head of a singly linked list L0 → L1 → … → Ln, reorder it in place to L0 → Ln → L1 → Ln−1 → L2 → …. Only node links may change, not values.
This is LeetCode 143 — Reorder List.
Example
[1,2,3,4] -> [1,4,2,3]
[1,2,3,4,5] -> [1,5,2,4,3]
Constraints: 1 ≤ n ≤ 5·10^4; 1 ≤ Node.val ≤ 1000.
Code runner format: one line with the list values. Implement reorderList(head) (in place); the harness prints the reordered list.