📝 Problem
A bookstore clerk has a book list stored as a linked list.
- Each node represents one book (its value = book ID).
- The clerk wants to reverse the list so that the last book comes first.
- Return the reversed book list as a Python array.
📊 Example
Input:
head = [3, 6, 4, 1]
Linked list form:
3 → 6 → 4 → 1
Output:
[1, 4, 6, 3]
💡 Solution Idea
- A singly linked list cannot be walked backwards.
- So, we collect all book IDs into a Python list, then simply reverse that list.
- Finally, return the reversed list.