An exhaustive “i not equal to j” loop typically starts out as
for i in range(t):
for j in range(t):
if i is not j:
To avoid repeating symmetric results (i.e. any i with j
just gives the same answer as j with i
), how can we additionally skip over these permuted instances in the loop above?