How to get expected running time of hash table?
Why not sort the array, then iterate over the sorted array, comparing the current number to the previous number.

n*log(n) for the sort, n for the iteration = 2n*log(n)