title: Ruby all possible permutations of an array of arrays (one liner?)
body: <p>Questions similar to this have been asked before on SO, but they're not quite what I need and I can't seem to arrive at my solution through altering/modifying those approaches.</p>
  
  <p>In any case, I have an array of arrays, as follows:</p>
  
  <pre><code>b= [["1"],["2"],["3"],["4"],["5"],["6"]]
  </code></pre>
  
  <p>(If it makes it easier to arrive at a solution, <code>b</code> can also be a one dimensional array, as follows: <code>["1","2","3","4","5","6"]</code>. Either type of input works for my needs.)</p>
  
  <p>and I would like to generate the following:</p>
  
  <pre><code>[["123456"],["213456"],["312456"],...] 
  </code></pre>
  
  <p>where each array in the output array is a unique permutation of the six numbers. I would also take it as a single array (e.g., <code>["123456", "213456",...]</code>). The order of the output isn't particularly important as long as each entry is unique and no number repeats in a string (e.g., "112345" isn't allowed). All 6 numbers must also be used in each entry, so I'm not interested in incremental output like <code>"123"</code>, either.</p>
  
  <p>As much as this sounds like it, this isn't a homework problem. I could brute for this thing and get the output I need. I just feel like there has to be a better, more elegant, solution.</p>