Skip to content

Instantly share code, notes, and snippets.

@tuankiet65
Created October 28, 2018 17:12
Show Gist options
  • Save tuankiet65/b9fad6eae3f48cfa1ddd141c215e8044 to your computer and use it in GitHub Desktop.
Save tuankiet65/b9fad6eae3f48cfa1ddd141c215e8044 to your computer and use it in GitHub Desktop.
def list_to_int(l):
res = 0
for digit in l:
res = (res * 10) + digit
return res
from itertools import permutations
l = list(permutations([1,1,2,2,3,3,3,7]))
l2 = []
for matrix in l:
l2.append(list_to_int(matrix))
print(l2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment