From bb515e51d67f37ba9c6dfbd2fd0930be873a5ada Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 12 Aug 2019 15:47:31 +0200 Subject: haskell problems 007 -> 010 --- python/helper/other.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 python/helper/other.py (limited to 'python/helper/other.py') 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 + ] -- cgit