You are given the head of a singly linked list L0 → L1 → … → Ln-1 → Ln.
Reorder the nodes to the interleaved pattern:
L0 → Ln → L1 → Ln-1 → L2 → Ln-2 → …
You must modify the list in place (rearranging the existing nodes, not their values alone) and return the head of the reordered list.
The list is given to you as a ListNode ({ val, next }); an empty list is null.
[1,2,3,4][1,2,3,4,5][1][1,2][1,2,3][1,2,3,4,5,6]