I was asked this question in a recent interview.
You are given an array that has a million elements. All the elements are duplicates except one. My task is to find t
Your approach seems fine. It could be that he was looking for an edge-case where the array is of even size, meaning there is either no unmatched elements or there are two or more. He just went about asking it the wrong way.