Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by driams.900
def translate(text: str) -> str:
res = ""
vowels = ["a", "e", "i", "o", "u", "y"]
i = 0
while i < len(text):
res = res + text[i]
if text[i] in vowels:
i +=3
elif text[i] == " ":
i +=1
else:
i +=2
return res
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!")
June 23, 2023
Comments: