From b7215be88c5ddfe4d2454f7d366bf4b2a952df2e Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sat, 21 Jan 2017 21:34:57 +0700 Subject: others/153x: rm 030.py (inaccurate algorithm) and add 035.py --- others/153x/035.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 others/153x/035.py (limited to 'others/153x/035.py') 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') -- cgit 1.4.1