title: calculating the number of “inversions” in a permutation
body: <p>Let A be an array of size <code>N</code>.
  we call a couple of indexes <code>(i,j)</code> an "inverse" if <code>i &lt; j</code> and <code>A[i] &gt; A[j]</code></p>
  
  <p>I need to find an algorithm that receives an array of size <code>N</code> (with unique numbers) and return the number of inverses in time of <code>O(n*log(n))</code>.</p>