I was asked this question recently in an interview :
What is the most efficient way to find a repeated number in a sorted array?
My answer was based on using a hash table with key as array element and number of repetitions in array as value; iterate the array and update hash table. In the end, hash table can be checked for elements with count > 1 ; those are the repeated elements.
Is there a better way to do this ?
Thanks.