Skip to content

Instantly share code, notes, and snippets.

@escalonn
Created May 12, 2022 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save escalonn/6a32a85de512556565024d280ef27d79 to your computer and use it in GitHub Desktop.
Save escalonn/6a32a85de512556565024d280ef27d79 to your computer and use it in GitHub Desktop.
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