title: Most compact, efficient, readable and clever solution for the "Find the first repeated character in a string" challenge
body: <p>I have a programming interview tomorrow and I'm practicing for it. I read that one of the common questions is to find the first repeated character in a string, using the prototype</p>
  
  <pre><code>size_t FindFirstRepeatedChar ( char * );
  </code></pre>
  
  <p>The best solution I could come up with is</p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;vector&gt;
  
  char FindFirstRepeatedChar ( char * S )
  {
     /* Returns the index of the first repeated character in the string S. 
        Assume S does indeed contain a repeat.
     */
     std::vector&lt;bool&gt; booVec(128,false)
     for (char * c1(S), * c2(S+strlen(S)); c1 != c2; ++c1)
     {
         size_t i((size_t)*c1); 
         if (booVec[i] == false) booVec[i] = true;
         else return (char)i;
     }   
  }
  </code></pre>
  
  <p>but I'm wondering</p>
  
  <p>(1) Is this wrong? </p>
  
  <p>(2) If it's not wrong, is there any way I can save electrons, i.e. optimize it further?</p>
  
  <p>(3) Is there a standard library algorithm that I can exploit to solve it in 1 line?</p>