title: How to find a duplicate element in an array of shuffled consecutive integers?
body: <p>I recently came across a question somewhere:</p>
  
  <blockquote>
    <p>Suppose you have an array of 1001 integers. The integers are in random order, but you know each of the integers is between 1 and 1000 (inclusive). In addition, each number appears only once in the array, except for one number, which occurs twice. Assume that you can access each element of the array only once. Describe an algorithm to find the repeated number. If you used auxiliary storage in your algorithm, can you find an algorithm that does not require it?</p>
  </blockquote>
  
  <p>What I am interested in to know is the <strong>second part</strong>, i.e., <strong>without using auxiliary storage</strong>.  Do you have any idea?</p>