Created
August 15, 2019 21:46
-
-
Save carcigenicate/3cd9dd7bbcbe8b2e7e3620c6b6df33a4 to your computer and use it in GitHub Desktop.
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 face_crowd(n: int) -> str: | |
def rec(depth: int, left: bool = False) -> str: | |
if depth >= n: | |
return "" | |
elif depth == 0: | |
return rec(depth + 1, True) + '( ͡° ͜ʖ ͡°)' + rec(depth + 1, False) | |
elif depth == 1: | |
return (rec(depth + 1, True) + '( ͡° ͜ʖ') if left else ('ʖ ͡°)' + rec(depth + 1, False)) | |
else: | |
return (rec(depth + 1, True) + '( ͡°') if left else ('͡°)' + rec(depth + 1, False)) | |
return rec(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment