public static LinkedListNode appendLastKNodes(LinkedListNode head, int k)
    {
        if (head == null) return null;
        
        LinkedListNode slow = head;
        LinkedListNode fast = head;
        
        for (int i = 0;i < k;i++)
        {
            if (fast == null) return null;
            fast = fast.getNext();
        }
        
        if (fast == null) return null;
        
        LinkedListNode prev = null;
        while (fast != null)
        {
            prev = slow;
            fast = fast.getNext();
            slow = slow.getNext();
        }
        
        prev.setNext(null);
        prev = slow;
        while (prev.getNext() != null)
        {
            prev = prev.getNext();
        }
        
        prev.setNext(head);
        
        return slow;
    }