title: Rotate subarrays to get a sorted array
body: <p>Given an array of integer <code>a[1..n]</code>, where all elements are unique. After rotation of the subarray <code>a[i..j]</code>, we will get a new array <code>a[1..i-1] a[j,j-1,..i+1,i] a[j+1..n]</code></p>
  
  <p>The question is to <strong>find the minimum steps of rotation to obtain an increasing array</strong> [Algorithm Problem].</p>
  
  <p>Is there a low complexity algorithm to solve this problem?</p>
  
  <p>Example 1. For array <code>3 2 4 1</code>, two steps are needed to sort the array.</p>
  
  <pre><code>   3 2 [4 1]   // rotate subarray [4 1]
  -&gt; [3 2 1] 4   // rotate subarray [3 2 1]
  -&gt; 1 2 3 4
  </code></pre>
  
  <p>Example 2. For array <code>5 4 6 7 3 1 2</code>, three steps are needed.</p>
  
  <pre><code>   5 4 [6 7 3] 1 2
  -&gt; 5 4 3 [7 6 1 2]
  -&gt; [5 4 3 2 1] 6 7
  -&gt; 1 2 3 4 5 6 7
  </code></pre>