title: Find a number where it appears exactly N/2 times
body: <p>Here is one of my interview question. Given an array of N elements and where an element appears <strong>exactly N/2</strong> times and the rest N/2 elements are <strong>unique</strong>. How would you find the element with a better run time?</p>
  
  <p>Remember the elements are not sorted and you can assume N is even. For example,</p>
  
  <pre><code>input array [] = { 10, 2, 3, 10, 1, 4, 10, 5, 10, 10 }
  </code></pre>
  
  <p>So here 10 appears extactly 5 times which is N/2.</p>
  
  <p>I know a solution with O(n) run time. But still looking forward to know a better solution with O(log n).</p>