static void removeDup(LinkedListNode n) {
        Set<Integer> set = new HashSet<Integer>();
        while (n != null) {
            int current = n.getValue();
            if (set.contains(current)) {
                n.pre.next = n.next;
            } else {
                set.add(current);
            }
            n = n.next;
        }
    }