Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by bloodyrabbit
import re
def translate(text: str) -> str:
return re.sub(r'((?P[aeiouy])..|(?P[^ ]).)', r'\g\g', text)
if __name__ == '__main__':
print("Example:")
print(translate('hieeelalaooo'))
# These "asserts" are used for self-checking and not for an auto-testing
assert translate('hieeelalaooo') == 'hello'
assert translate('hoooowe yyyooouuu duoooiiine') == 'how you doin'
assert translate('aaa bo cy da eee fe') == 'a b c d e f'
assert translate('sooooso aaaaaaaaa') == 'sos aaa'
print("Coding complete? Click 'Check' to earn cool rewards!")
Sept. 15, 2021