Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.
Sublist Reversal
Use a dummy node and repeatedly move the next node to the front of the reversed segment.