python permutations itertools memory code example
Example: python itertools.permutations use too much memory
a = [1, 2, 3]
n = 3
heapPermutation(a, n, n)
print()
perm_iterator = itertools.permutations(a)
for item in perm_iterator:
print(item)