public static ListNode DedupLoop(ListNode loopHead)
    {
        if (loopHead != null && loopHead.Next == loopHead)
        {
            ListNode start = loopHead;

            ListNode cur = start.Next;

            while (cur != loopHead && cur != null) {
                if (cur.Value != start.Value) {
                    start.Next = cur;
                    start = cur;
                }
            }
        }

        return loopHead;
    }