Explorar o código

Lexicographic permutations

Adel Qalieh %!s(int64=13) %!d(string=hai) anos
pai
achega
e2f6a60f28
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      24.py

+ 8 - 0
24.py

@@ -0,0 +1,8 @@
+from itertools import permutations
+
+lexorder = 1
+
+for permutation in permutations("0123456789", 10):
+	if lexorder == 1000000:
+		print ''.join(permutation)
+	lexorder += 1