思路:类似剑指offer58 左旋转字符串
public ListNode rotateRight(ListNode head, int k){
if(head==null||head.next==null||k==0) return head;
int count=1;
ListNode node=head;
while(node.next!=null){
count++;
node=node.next;
}
int len=count-k%count;
if(len==count) return head;
//形成循环链表
node.next=head;
while(len-->0){
node=node.next;
}
ListNode res=node.next;
node.next=null;
return res;
}