title: Combination of a list of lists so that each combination has unique elements
body: <p>Ok so, I have a list of lists, like the title says and I want to make combinations of k lists in which every list has different elements than the rest.</p>
  
  <p><strong>Example</strong>:</p>
  
  <p>I have the following list of lists:</p>
  
  <pre><code>{ {1,2,3} , {1,11} , {2,3,6} , {6,5,7} , {4,8,9} }
  </code></pre>
  
  <p>A valid 3-sized combination of these lists could be: </p>
  
  <pre><code>{ {1,11}, {4,8,9} ,{6,5,7} }
  </code></pre>
  
  <p>This is only ONE of the valid combinations, what I want to return is a list of all the valid combinations of K lists.</p>
  
  <p>An invalid combination would be: </p>
  
  <pre><code>{ {1,11} ,{2, 3, 6}, {6, 5, 7} } 
  </code></pre>
  
  <p>because the element 6 is present in the second and third list.</p>
  
  <p>I already have a code that does this but it just finds all possible combinations and checks if they are valid before addding it to a final result list. As this list of lists is quite large (153 lists) when K gets bigger, the time taken is ridiculously big too (at K = 5 it takes me about 10 minutes.) </p>
  
  <p>I want to see if there's an efficient way of doing this.
  Below is my current code (the lists I want to combine are attribute of the class Item):</p>
  
  <pre><code>public void recursiveComb(List&lt;Item&gt; arr, int len,  int startPosition, Item[] result)
  {
      if (len == 0)
      {            
          if (valid(result.ToList()))
          {                
            //Here I add the result to final list
  
            //valid is just a function that checks if any list has repeated elements in other  
          }            
          return;
      }
  
      for (int i = startPosition; i &lt;= arr.Count - len; i++)
      {       
          result[result.Length - len] = arr[i];
          recursiveComb(arr, len - 1,  i + 1, result);
      }
  }
  </code></pre>