development #11

Merged
luizfelipe9627 merged 20 commits from development into master 2022-11-02 13:01:51 +00:00
Showing only changes of commit be99feb845 - Show all commits

View File

@ -1,4 +1,16 @@
export function longestWords(words) {
// implementar logica aqui
const longestWords = words.sort(
(a, b) => {return b.length - a.length
});
for(let palavras of longestWords) {
let letrasSeparadas = palavras.split('');
if(letrasSeparadas.length === 8) return longestWords.slice(0, 1);
else if(letrasSeparadas.length === 4) return longestWords.slice(0, 2);
else return longestWords.slice(0, 3);
}
return longestWords;
}