public ListNode rotateRight_lint(ListNode head, int k) {
        if (head == null || head.next == null)
            return head;
        int n = getLength(head);
        k = k % n;
        if (k == 0)
            return head;
        ListNode dummy = new ListNode(-1);
        dummy.next = head;
        // head = dummy;
        ListNode ptr = dummy;
        for (int i = 0; i < k; ++i) {
            ptr = ptr.next;
        }
        ListNode tail = dummy;
        while (ptr.next != null) {
            tail = tail.next;
            ptr = ptr.next;
        }
        // right position
        ptr.next = dummy.next;
        dummy.next = tail.next;
        tail.next = null;
        return dummy.next;
    }