title: Find the majority element in array
body: <p>The majority element is the element that occurs more than half of the size of the array.</p>
  
  <p>How to find the majority element in an array in <code>O(n)</code>?</p>
  
  <p>Example input:</p>
  
  <pre><code>{2,1,2,3,4,2,1,2,2}
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>2
  </code></pre>