title: How to get ALL combinations of a list of words using ANY number of words
body: <p>I have searched but I can't find anything that matches my query. I have seen lots of solutions where people want all combinations of numbers/words that use ALL the options, but none like this...</p>
  
  <p>Here's an example:</p>
  
  <pre><code>apple pear
  </code></pre>
  
  <p>This should generate:</p>
  
  <blockquote>
    <p>apple<br>
    pear<br>
    apple pear<br>
    pear apple</p>
  </blockquote>
  
  <p>Or even...</p>
  
  <pre><code>apple pear banana
  </code></pre>
  
  <blockquote>
    <p>apple<br>
    pear<br>
    banana<br>
    apple pear<br>
    apple banana<br>
    pear banana<br>
    ...<br>
    ...<br>
    banana pear apple  </p>
  </blockquote>
  
  <p>The key is, ALL possible combinations that use any of the words zero or one times in ANY order. :)</p>