Amazon Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Phone Interview
Thanks almost missed that approach ,I used hashtable . But never the less i could clear the round
Yeah, I would use a hash table too. My values would be booleans which I would simply toggle. Whichever value is true after parsing the array, the key would be that number.
need to check just half of the array.
garimaa.blogspot.in/2012/04/program-12th-in-c_11.html
wrong answer kido!!!
It is only applicable if the array is sorted but it is no where mentioned that it is sorted.Go for XOR operation
XOR all the numbers together you will get the odd one out. O(n)
- Bob April 10, 2012