static int[] removeDuplicates(int[] unsorted) {
        Map<Integer, Integer> numberToCountMap = new HashMap();
        int length = unsorted.length;
        for (int i=0; i<length; i++) {
            if (!numberToCountMap.containsKey(unsorted[i])) {
                numberToCountMap.put(unsorted[i], 1);
            }
        }
        int[] results = new int[numberToCountMap.size()];
        int tmp = 0;
        for (Integer i : numberToCountMap.keySet()) {
            results[tmp] = i;
            tmp++;
        }
        return results;
    }