title: Move or shift array element to last postion by condition + ruby array
body: <p>I need to shift an element to last position by condition.
  For ex. 
  <code>[1,2,3]</code> and to put <code>1</code> in last in array, without executing unnecessary loops.</p>
  
  <p><code>o/p [2,3,1]</code> for the above condition array will be dynamic and put particular element on last by condition.  </p>
  
  <p>I tried like this:</p>
  
  <pre><code>sd = [1,2,3]
  sd.map{|d| sd.last(d) if d ==1 }
  </code></pre>
  
  <p>but the output is <code>[[3], nil, nil]</code></p>