Created
March 3, 2019 22:22
-
-
Save animatedlew/d8e608afae714fdf981bb06291223e9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List | |
def perm(input: str) -> List[str]: | |
return [ | |
head + p | |
for i, head in enumerate(input) | |
for p in perm(input[:i] + input[i+1:]) | |
] if input else [input] | |
print(perm('abc')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.