aboutsummaryrefslogtreecommitdiff
path: root/python/helper/other.py
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-08-12 15:47:31 +0200
committerCharles <sircharlesaze@gmail.com>2019-08-12 15:47:31 +0200
commitbb515e51d67f37ba9c6dfbd2fd0930be873a5ada (patch)
treee86abea100d2c02a5dad7b6d5f0bf29c307bae04 /python/helper/other.py
parent1879caa1dd80cb11dd62403663917ad4bf7cc68e (diff)
downloadproject_euler-bb515e51d67f37ba9c6dfbd2fd0930be873a5ada.tar.gz
project_euler-bb515e51d67f37ba9c6dfbd2fd0930be873a5ada.tar.bz2
project_euler-bb515e51d67f37ba9c6dfbd2fd0930be873a5ada.zip
haskell problems 007 -> 010
Diffstat (limited to 'python/helper/other.py')
-rw-r--r--python/helper/other.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/helper/other.py b/python/helper/other.py
new file mode 100644
index 0000000..05854d8
--- /dev/null
+++ b/python/helper/other.py
@@ -0,0 +1,8 @@
+from itertools import permutations
+
+
+def n_digits_pandigital(n, front_zero=False):
+ return [
+ int(''.join(map(lambda n: str(n), x)))
+ for x in permutations(range(n)) if front_zero or x[0] != 0
+ ]