IBM interview question

Check if there are duplicates in array in O(n)