Given the head of a singly linked list, reverse the list and return its new head.
head
The list is given to you as a ListNode ({ val, next }); return the head of the reversed list.
ListNode
{ val, next }
[1,2,3,4,5]
[1,2]
[]
[7]
[-3,0,3,9]