📝 Problem

A bookstore clerk has a book list stored as a linked list.


📊 Example

Input:

head = [3, 6, 4, 1]

Linked list form:

3 → 6 → 4 → 1

Output:

[1, 4, 6, 3]


💡 Solution Idea