Delete the Head of a Linked List

You are given a singly linked list (as an array of node values from head → tail). Remove the first node of the list and return the head of the list that…

You are given a singly linked list (as an array of node values from **head → tail**). Remove the first node of the list and return the head of the list that remains. The operation only changes which node the head refers to — the values of the surviving nodes stay in their original order. The taught pointer-update approach runs in constant time and uses constant extra space, with no traversal of the list. If the list is already empty, there is nothing to remove, so return an empty list (null head). For example, with `head = [9, 4, 7, 2]`, the result is `[4, 7, 2]`.

- `0 <= nodes.length <= 10^5` - `-10^9 <= nodes[i] <= 10^9` - The taught pointer-update approach runs in constant time and uses constant extra space.

Example 1: input head = [9,4,7,2]; output [4, 7, 2]. The first node (value 9) is unlinked. The head now refers to the node holding 4, and the rest of the chain is untouched.

Example 2: input head = [15]; output []. The only node is removed, leaving an empty list whose head is null.

Example 3: input head = []; output []. There is no node to delete, so the empty list is returned unchanged.

Category: Linked List. Topic: linked-list. Difficulty: Easy. Patterns: linked-list-traversal.