Your question is Reverse a Custom 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.
Blurb's preview pipeline stores ordered page-preview records in a custom singly linked list. Implement reverse_linked_list(head) to reverse the list in place and return the new head.
Each node is provided by the interviewer and has two fields: value, containing any page-preview record, and next, containing another node or None. Do not create replacement nodes or use an auxiliary collection.
head, either a Node object representing the first node of a singly linked list or None.Node object that was previously the tail, now serving as the new head. Return None for an empty list.next pointer.value and nextvalue may be any Python objectdef reverse_linked_list(head):