浏览代码

Lexicographic permutations

Adel Qalieh 13 年之前
父节点
当前提交
e2f6a60f28
共有 1 个文件被更改,包括 8 次插入0 次删除
  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