Zscaler policy-processing code may maintain ordered rule identifiers in a mutable singly linked list. Implement a function that creates the list from initial values and applies a sequence of operations.
The supported operations are:
insert_head, represented as ["insert_head", value]insert_tail, represented as ["insert_tail", value]delete, represented as ["delete", value], which removes only the first matching value if it existsreverse, represented as ["reverse"]Return the final linked-list contents as a Python list. The linked list must be manipulated with node pointers. Do not use Python list insertion, deletion, or reversal to perform the operations.
Implement linked_list_operations(values, operations), where values is a list of integers used to construct the initial singly linked list, and operations is a list of valid operation lists. Return a list of integers containing the final node values in order.
def linked_list_operations(values, operations):