title: Shuffle an array as many as possible
body: <p>I have an array like this  </p>
  
  <pre><code>[0,2,3]
  </code></pre>
  
  <p>The possible shuffling of this array are  </p>
  
  <pre><code>[0,2,3], [2,3,0], [3,0,2], [3,2,0], [0,3,2], [2,0,3]
  </code></pre>
  
  <p>How can I get these combinations?  The only idea I have in mind currently is  </p>
  
  <pre><code>n = maximum num of possible combinations, coms = []
  while( coms.length &lt;= n )
      temp = shuffle( original the array );
      if temp is there in coms
         return
      else 
         coms.push(temp);
  </code></pre>
  
  <p>But I do not think this is efficient, as here we are blindly depending on uniform distribution of shuffle method.</p>
  
  <p>Is there alternative findings for this problem? </p>