Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by tamagoyaki
def translate(text: str) -> str:
import re
text = re.sub("(a)aa|(i)ii|(u)uu|(e)ee|(o)oo|(y)yy",r"\1\2\3\4\5\6",re.sub("([bcdfghjklmnpqrstvwxz])[aiueoy]","\\1",text))
# your code here
return text
print("Example:")
print(translate("hieeelalaooo"))
# These "asserts" are used for self-checking
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("The mission is done! Click 'Check Solution' to earn rewards!")
Sept. 25, 2023
Comments: