mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-22 08:21:12 -04:00
Update and rename permutation.py to permutations.py
This commit is contained in:
parent
0b6dbbaa27
commit
a4fe8d519e
1 changed files with 1 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
|||
# author: bt3gl
|
||||
|
||||
|
||||
def permutation(string) -> list:
|
||||
def permutations(string) -> list:
|
||||
|
||||
if len(string) == 1:
|
||||
return [string]
|
||||
|
@ -14,9 +14,3 @@ def permutation(string) -> list:
|
|||
result += [char + perm]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('Testing permutation()...')
|
||||
string = "bt3gl"
|
||||
print(f'Permutation of {string}: {permutation(string)}')
|
Loading…
Add table
Add a link
Reference in a new issue