Coding Trainer
Reverse Linked List II
Problem
Given the head of a linked list and two integers left and right, reverse the nodes from position left to right in one pass.
Example: head=[1,2,3,4,5], left=2, right=4 → [1,4,3,2,5]