Easy · Linked Lists
Print From End
Given the head of a singly linked list, return its node values in reverse order, from the tail to the head, without modifying the list.
Examples
Example 1
{
"values": [1, 2, 3, 4]
}Output: [4, 3, 2, 1]
Example 2
{
"values": [5, 9, 2]
}Output: [2, 9, 5]
Rebuild it in the studio
Core interview problems are free with a full runner and lessons; Pro opens the complete library.