30:00
Given the head of a singly linked list, reverse the list, and return the reversed list.
The number of nodes is in the range [0,5000][0, 5000][0,5000].
−5000≤Node.val≤5000-5000 \leq \text{Node.val} \leq 5000−5000≤Node.val≤5000
Init: prev = null, curr = head
1
2
3
4
5
prev → NULL
nxt → NULL