Given the head of a singly linked list, reverse the list and return the reversed list.
Input: 1 β 2 β 3 β 4 β 5 Output: 5 β 4 β 3 β 2 β 1 Input: 1 β 2 Output: 2 β 1
Unlock hints progressively β start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features