I have a list of lists. I want to count the number of independent lists. By independent I mean that if a list has at least 1 number that is in another list then it is not independent.
If 2 list share a number then they count as 1 independent list. If 3 list share a number then it also counts as 1 independent list and so on.
Example 1
Input = [[1,2],[2,3],[4,5]]
Output = 2
## ([4,5] and since [1,2] and [2,3] intersect, it counts as 1)
Example 2
Input = [[3004,2002],[2001,3000],[4500,5000,3004]]
Output = 2
## ([2001,3000] and since [4500,5000,3004] and [3004,2002] intersect, it counts as 1)