title: Union of multiple sets in python
body: <pre><code>[[1, '34', '44'], [1, '40', '30', '41'], [1, '41', '40', '42'], [1, '42', '41', '43'], [1, '43', '42', '44'], [1, '44', '34', '43']]
  </code></pre>
  <p>I have a list of lists. My aim is to check whether any one sublist has anything in common with other sublists(excluding the first index object to compare). If it has anything in common then unify those sublists.</p>
  <p>For example, for this example my final answer should be something like:</p>
  <pre><code>[[1, '34', '44', '40' '30', '41', '42', '43']]
  </code></pre>
  <p>I can understand that I should convert the sublists to sets and then use union() and intersection() operations. But what I am stuck with is how to compare each set/sublist. I can't run a loop over the list and compare each sublist one by one as the contents of the list would be modified and this would lead to an error.</p>
  <p>What I want to know is there any efficient method to compare all the sublists(converted to sets) and get a union of them?</p>