about summary refs log tree commit diff
path: root/others/153x/035.py
diff options
context:
space:
mode:
Diffstat (limited to 'others/153x/035.py')
-rwxr-xr-xothers/153x/035.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/others/153x/035.py b/others/153x/035.py
new file mode 100755
index 0000000..1a428e7
--- /dev/null
+++ b/others/153x/035.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+from itertools import permutations
+
+with open("PERMUTE.INP") as f:
+    l = sorted(set(permutations(f.readline().strip())))
+
+with open("PERMUTE.OUT", "w") as f:
+    f.write("{}\n".format(len(l)))
+    for i in l:
+        f.write("".join(i) + '\n')