title: Minimum number of operations to make every element of an array consecutive if ordered
body: <p>Given an array, return the minimum number of operations required to make all the elements of the array continuous. In one operation, any element of the array can be replaced with any integer. For example =&gt;</p>
  <pre><code>arr = [6, 4, 1, 7, 10]
  </code></pre>
  <p>the output should be continuousElementsArray(arr) = 2. By converting 1 -&gt; 5 and 10 -&gt; 8 Final array is</p>
  <pre><code>arr = [6, 4, 5, 7, 8]
  </code></pre>
  <p>Continuous mean that number should be consecutive like {1,2,3} or {2,3,1}. Here order doesn't matter. And every number should be unique (No repetition is allowed).</p>