Skip to main content
2 of 3
add explanations
AsukaMinato
  • 10.4k
  • 1
  • 17
  • 44
n = 2;
vals = {0, 1};
Tuples[vals, {n}] // DeleteDuplicatesBy[#, Sort] &

Some explanations:

The key is: you "sort" the list to see whether they are duplicate.

So I use Sort to be DeleteDuplicatesBy's condition.

AsukaMinato
  • 10.4k
  • 1
  • 17
  • 44