diff --git a/Python/24.Lexicographic Permutations/anju3999.py b/Python/24.Lexicographic Permutations/anju3999.py new file mode 100644 index 0000000..7d34ee0 --- /dev/null +++ b/Python/24.Lexicographic Permutations/anju3999.py @@ -0,0 +1,10 @@ +#Euler 24 +from itertools import permutations + +def lexicographical_permutation(str): + permutation = sorted(''.join(chars) for chars in permutations(str)) + for x in permutation: + print(x) + +str = 'abc' +lexicographical_permutation(str) \ No newline at end of file diff --git a/README.md b/README.md index b794d72..d1d6bd7 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Happy Contributing! 😃 | 21 | [Amicable numbers](https://projecteuler.net/problem=21) | | | | | | | | | | | | | | 22 | [Names scores](https://projecteuler.net/problem=22) | | | | :white_check_mark: | | | | | | | | | | 23 | [Non-abundant sums](https://projecteuler.net/problem=23) | | | | | | | | | | | | | -| 24 | [Lexicographic permutations](https://projecteuler.net/problem=24) | | | | | | | | | | | | | +| 24 | [Lexicographic permutations](https://projecteuler.net/problem=24) | | | | :white_check_mark: | | | | | | | | | | 25 | [1000-digit Fibonacci number](https://projecteuler.net/problem=25) | | | | :white_check_mark: | | | | | | | | | | 26 | [Reciprocal cycles](https://projecteuler.net/problem=26) | | | | | | | | | | | | | | 27 | [Quadratic primes](https://projecteuler.net/problem=27) | | :white_check_mark: | | | | | | | | | | |