Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First for "Bird Language" solution in Clear category for Bird Language by yurimelnyk
from typing import List
VOWELS = 'aeiouy'
def translate(phrase: str) -> str:
decoded_words: List[str] = [decode_word(word) for word in phrase.split()]
return ' '.join(decoded_words)
def decode_word(word: str) -> str:
i: int = 0
decoded: str = ''
while i < len(word):
letter = word[i]
decoded += letter
i += 2 if letter not in VOWELS else 3
return decoded
May 16, 2019