Given the head of a singly linked list, reverse the list in place and return the new head. Do not create a second list or use extra nodes.
head, the head node of a singly linked list. Each node has fields val and next.def reverse_linked_list(head):