title: How can I group the elements of a set into disjoint subsets in javascript?
body: <p>In how many ways can a group of 9 people work in 3 disjoint subgroups of 2, 3 and 4 persons? How can I generates all the possibilities via backtracking with javascript.</p>
  
  <p>Example:</p>
  
  <pre><code>Gs = group([aldo,beat,carla,david,evi,flip,gary,hugo,ida],[2,2,5]);
  
  console.log(Gs); // [[aldo,beat],[carla,david],[evi,flip,gary,hugo,ida]], ...
  </code></pre>
  
  <p>Note that I do not want permutations of the group members; i.e. [[aldo,beat],...] is the same solution as [[beat,aldo],...]. However, there's a difference between [[aldo,beat],[carla,david],...] and [[carla,david],[aldo,beat],...].</p>
  
  <p>*No libraries please.</p>