Created
October 28, 2018 17:12
-
-
Save tuankiet65/b9fad6eae3f48cfa1ddd141c215e8044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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