Substituição de "the"
Crie uma função que substitua "the" na frase por "an" ou "a". Lembre-se de que, se a próxima palavra começar com uma vogal, use "an". Se começar com uma consoante, use "a".
Exemplos
replace_the("the dog and the envelope") ➞ "a dog and an envelope"
replace_the("the boy ran at the wall") ➞ "a boy ran at a wall"
replace_the("the egg, the spoon and the espionage") ➞ "an egg, a spoon and an espionage"Notas
- As frases sempre estarão em minúsculas.
- A última palavra da frase nunca será "the".
- Esta regra não abrange casos-limite como "an hour" ou "a unique thing" (porque soam diferente do que a regra prevê).