Problem statement
You are given an array of whole numbers and asked one yes-or-no question: does any value appear at least twice?
The answer is true the moment a second copy turns up, and false only after the whole array has been read.
Examples
Input[1, 2, 3, 1]
Outputtrue
1 appears at index 0 and again at index 3.
Input[1, 2, 3, 4]
Outputfalse
Every value is distinct, so the whole array has to be read.
The walkthrough is part of Premium
The statement and the examples above stay free. The full how-to-solve walkthrough, the cost notes in plain words and the interactive step-by-step visualizer unlock with a Premium plan.
See pricing