THIS IS A FUNCTION PROBLEM. YOU NEED TO COMPLETE THE SOLVE FUNCTION ONLY. PLEASE DON'T CHANGE CODE OF main() FUNCTION. THIS IS FOR YOUR OWN GOOD.
In this problem you have to complete a function. There are three parameters of the solve function.
You are also given two integers L and R you need to rotate the sublink list from L to R in anticlock wise manner by 1 element.
For Example:
Given Linked list is 2->3->4->5->6->7 and L=2 and R=5
rotating the sublinklist 3->4->5->6 we get, 4->5->6->3. So, our new linked list is 2->4->5->6->3->7.
You need to return the start node of new linked list.
Length of linked list ≤106