Reverse In Range
easy
1. Given a singly linklist, Reverse a linkedlist from position starting position to end position. 2. Do it in one-pass. without using any extra space. 3. Indexing start from numeric 1.
Constraints
1 <= size Of LinkedList <= 10^6 1 <= starting Position, ending Position <= 10^6
Format
Input
8->8->14->1->10->12->null 3 5
Output
8->8->10->1->14->12->null
Example
Sample Input
6
8 8 14 1 10 12
3
5
Sample Output
8 8 10 1 14 12