title: Maximum of three integers using bitwise operations?
body: <p>How would I return the maximum of three unsigned integers using only bit-wise operations, such as !,~,|,&amp;,^,+,>>,&lt;&lt;. I don't know where to start. Any help would be appreciated.</p>
  
  <p>edit:</p>
  
  <p>I am only allowed to use the given legal ops, thats it.</p>
  
  <pre><code>/** maxOfThree - Returns the maximum of three integers.
  * NOTE: x, y, z are all in the range [0, TMax].
  * Examples: maxOfThree(1, 2, 3) = 3
  * Legal Ops: ! ~ &amp; ^ | + &lt;&lt; &gt;&gt;
  * Max Ops: 25
  int maxOfThree(int x, int y, int z) {
  }
  </code></pre>