Jelajahi Sumber

Lexicographic permutations

Adel Qalieh 13 tahun lalu
induk
melakukan
e2f6a60f28
1 mengubah file dengan 8 tambahan dan 0 penghapusan
  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