Asked 3/27/2025, 1:28:10 PM
Modified 3/27/2025, 1:28:10 PM
@leonov
Given the head of a singly linked list, reverse the list and return the new head.
Example:
Input: 1 -> 2 -> 3 -> 4 -> 5 Output: 5 -> 4 -> 3 -> 2 -> 1