title: A simple code to detect the permutation sign
body: <p>supposed I have an array of integers:</p>
  
  <pre><code>1 2 5 3 7 6
  </code></pre>
  
  <p>What is a simple enough algorithm that determines if this is an even or odd permutation of the numbers in sorted fashion (i.e. <code>1 2 3 5 6 7</code>)? Performance is not terribly important here; I'd rather have a simple code.</p>