title: How to find all possible combinations given this criteria?
body: <p>I have an array of <code>Card</code> instances.</p>
  
  <pre><code>Card[] allCards;
  </code></pre>
  
  <p>I am supposed to get all the possible combinations of these cards, under the following conditions:</p>
  
  <ul>
  <li>All of the combinations must have a minimum of 3 cards.</li>
  <li>A combination has no card limit (so if there are a total of 15 cards, you know there can be a combination of 15 cards, others of 13, 10, etc).</li>
  </ul>
  
  <p>For college purposes, I am not supposed to use any fancy library capable of doing this job easier.</p>
  
  <p>I've done it with pairs, sure, but considering that there is no limit, the algorithm I would usually do would not work.</p>
  
  <p>It is pretty much what they ask here for python: <a href="https://stackoverflow.com/questions/6312396/find-all-possible-combinations">Find all possible combinations</a></p>
  
  <p>Any ideas? I don't want code or anything - I'm just lost with the algorithm/idea.</p>
  
  <p><strong>My Problem (more detailed)</strong></p>
  
  <p>I can make pairs by making two loops (one within the other). I can make triplets by having three loops (one within another within another).</p>
  
  <p>But I don't know how to do this specific problem because:</p>
  
  <ul>
  <li>What if the array has 15 cards? I can't write 15 loops...</li>
  <li>And then of course I need to go down to 14, 13, 12 loops... (because all the combinations are not of 15 elements each, there can be combinations of 14, 13, 12 elements when working with this 15-elements-array)</li>
  </ul>
  
  <p>I can find some combinations, but not dynamically.</p>