Created
May 12, 2022 12:23
-
-
Save escalonn/6a32a85de512556565024d280ef27d79 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
import re | |
words = {} | |
for i in range(int(input())): | |
word = input().lower() | |
words[re.sub('[a-z]', lambda m: 'z' if m.group() in 'aeiou' else 's', word)] = word | |
print(re.sub(r'\w+', | |
lambda m: ''.join(c2.upper() if c1.isupper() else c2 | |
for c1, c2 in zip(m.group(), words[m.group().lower()])), | |
input())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment