fork download
  1. nestedArray = [[2,3],[3,2],[1,2]]
  2. combinations = set()
  3. for array in nestedArray:
  4. combination = set()
  5. combination.add(array[0])
  6. combination.add(array[1])
  7. combination = frozenset(combination)
  8. if not (combination in combinations):
  9. print("not found")
  10. combinations.add(combination)
  11.  
  12. print(combinations)
Success #stdin #stdout 0.04s 9604KB
stdin
Standard input is empty
stdout
not found
not found
{frozenset({2, 3}), frozenset({1, 2})}