title: Generate all "unique" subsets of a set (not a powerset)
body: <p>Let's say we have a Set <code>S</code> which contains a few subsets:</p>
  
  <pre><code>- [a,b,c]
  - [a,b]
  - [c]
  - [d,e,f]
  - [d,f]
  - [e]
  </code></pre>
  
  <p>Let's also say that S contains six unique elements: <code>a, b, c, d, e</code> and <code>f</code>.</p>
  
  <p>How can we find all possible subsets of <code>S</code> that contain each of the unique elements of <code>S</code> exactly once?</p>
  
  <p>The result of the function/method should be something like that:</p>
  
  <ol>
  <li><code>[[a,b,c], [d,e,f]];</code></li>
  <li><code>[[a,b,c], [d,f], [e]];</code></li>
  <li><code>[[a,b], [c], [d,e,f]];</code></li>
  <li><code>[[a,b], [c], [d,f], [e]].</code></li>
  </ol>
  
  <p>Is there any best practice or any standard way to achieve that?</p>
  
  <p>I would be grateful for a Pseudo-code, Ruby or Erlang example.</p>