Reverse a linked list in place.
Asked in the round 1 stage. Implement the function below for a singly linked list. Return the new head after reversing the existing nodes; do not create replacement nodes.
head is either None or a ListNode with value and next fields. Return the new head. The test cases represent lists as arrays of node values.
def reverse_list(head):