Given the head of a singly linked list, reverse the direction of every next pointer.
Return the new head. Each node has the shape { val, next }.
Inputhead = [1, 2, 3, 4, 5]
Output[5, 4, 3, 2, 1]
Inputhead = [1, 2]
Output[2, 1]
0 ≤ number of nodes ≤ 5,000