Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First (='ω'=) solution in Clear category for Bird Language by Magu
import re
def translate(text: str) -> str:
#([aeiouy]) -> \1, ([~aeiouy\s]) -> \1
return re.sub('([aeiouy]){3}', r'\1', re.sub('([^aeiouy\s])[aeiouy]', r'\1', 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. 4, 2021
Comments: