Amazon interview question

Find out if the array has repeated numbers in it. (make it more time efficient)

Interview Answer

Anonymous

9 Feb 2012

Create a hash map for the array which maps every number to its frequency. If there exists an element with frequency > 1 => there is repetition! mapfrequency; // map