Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bird Language by freeman_lex
def translate(text: str) -> str:
result = ""
i = 0
l = len(text)
while i < l:
char = text[i]
result += char
i += 1 + (char != " ") + (char in "aeiouy")
return result
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!")
Oct. 1, 2022