Find repeating element in array
I felt this question deserves a post of its own. So here it is :
Q5. In an array from 1 to n, one number is present twice. How to do you determine which one?
There are multiple answers - all correct. We would, obviously, aim for the optimized one - benchmark parameters being time & space complexity
Source : Algorithms from 100 Interview Questions for Software Developers