All Problems

Reverse Linked List II

Mediumlinked-listExpected: O(n) time, O(1) spaceInterview Context
linked-list

Problem

Given the head of a singly linked list and two integers left and right, reverse the nodes from position left to position right.

Loading...