Created
November 20, 2017 06:19
-
-
Save sakekasi/e3413e64d72735e95044a977d258c3cd to your computer and use it in GitHub Desktop.
mystery
This file contains 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
def mystery(lst, n): | |
if n == 0: | |
return lst | |
elif lst == []: | |
return lst | |
else: | |
return mystery(lst[1:], n-1) + [lst[0]] | |
ans = mystery([1,3,4,7,9], 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment