O número mais brilhante, emocionante e fantástico
Dado um número n, retorne uma frase que descreva o número das seguintes maneiras.
- Sempre comece a string com "The most".
- Se
nfor divisível por 1 sem deixar resto, adicione "brilliant" à frase. - Se
nfor divisível por 2 sem deixar resto, adicione "exciting" à frase. - ... 3, adicione "fantastic" à frase.
- ... 4, adicione "virtuous" à frase.
- ... 5, adicione "heart-warming" ...
- ... 6, adicione "tear-jerking" ...
- ... 7, adicione "beautiful" ...
- ... 8, adicione "exhilarating" ...
- ... 9, adicione "emotional" ...
- Se
nfor divisível por 10 sem deixar resto, adicione inspiring à frase. - Sempre termine a string com "number is"
n!
Exemplos
describe_num(13) ➞ "The most brilliant number is 13!"
# 13 is evenly divisible by 1 only
describe_num(4) ➞ "The most brilliant exciting virtuous number is 4!"
# 4 is evenly divisible by 1, 2 and 4
describe_num(21) ➞ "The most brilliant fantastic beautiful number is 21!"
# 21 is evenly divisible by 1, 3 and 7
describe_num(60) ➞ "The most brilliant exciting fantastic virtuous heart-warming tear-jerking inspiring number is 60!"
# 60 is evenly divisible by 1, 2, 3, 4, 5, 6 and 10Observações
- Adicione as palavras à frase na ordem em que aparecem na lista.
- BONUS: Tente encontrar o menor número que use todas as palavras possíveis da frase!