Your question is Reverse Singly Linked List. 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.
In Snowflake-style coding interviews, a common data structure task is to reverse a singly linked list in place. Write a function that takes the head of a singly linked list and returns the head of the reversed list.
head, the first node of a singly linked list, or null for an empty list.val and next.val and nextdef reverse_linked_list(head):