Given the head of a singly linked list and two integers left and right (1-indexed, left <= right), reverse the nodes from position left to position right, then return the head of the modified list.
Input / output
head: ListNode, left: int, right: int (JSON test fixture for head is a plain array of node values, e.g. [1, 2, 3, 4, 5] means 1 -> 2 -> 3 -> 4 -> 5 -> null)ListNode (serialized the same way)-500 <= node value <= 5001 <= left <= right <= number of nodesCan you do it in a single pass through the list, without ever counting the length or making a second traversal?