A small clarification. I am not a native English speaker, but it seems that at least in the world of computers, the word unique is a bit overloaded. As far as I can tell in most programming environments the word unique is a synonym of the word distinct and in this article we use that meaning. So given a list of values like this foo, bar, baz, foo, zorg, baz by unique. Naive Approach for Find The Duplicate Number Method 1 (Brute Force) Traverse the array from index 0 and for every element check if it repeated in the array elements ahead of it. If it is repeated, then this is the duplicate element, else continue for the next element. Time Complexity O(n 2) JAVA Code.