Jan 17, 2008

Repeated Number in an array

An array of length n+1 is given which is filled with the numbers 1... n such that only 1 number is repeated. Find the repeated number.

Another variation of the problem asks to find repeated numbers if there are two such repetitions.

No comments: