Your question is Reverse a Linked List Iteratively. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Resultant project workflows may process items in linked order. Given the head of a singly linked list, reverse the list in place using iteration and return the new head.
The input is head, either None or a reference to a ListNode with fields val and next. The function must return the new head after reversing every next pointer. Do not create new list nodes. For examples and test cases, linked lists are represented as arrays of values, where [] represents None.
def reverse_linked_list(head):