Two Pointers
Single Linked List
61. Rotate List
Medium1 solution1 playground
Solutions:
Watch the two panels: head (top) shrinks to the first n − k nodes once left.next = None runs, and sentinel (bottom) grows as sentinel.next = left.next then right.next = head is rewired — by the last step sentinel is the rotated list. The legacy view depicted this as a Y-fork; the two-panel layout makes the rewire equally readable.