feature #1

Merged
wellingtonCarlos merged 11 commits from feature into master 2022-11-02 18:10:07 +00:00
Showing only changes of commit f577fc0a57 - Show all commits

View File

@ -1,4 +1,24 @@
export function longestWords(words) {
// implementar logica aqui
let letra = words
let tamanho = 0
let maximo = [' ']
for (let i = 0; i < letra.length; i++) {
if (letra[i].length >= tamanho) {
tamanho = letra[i].length
if (maximo[maximo.length - 1].length < letra[i].length) {
maximo = []
maximo.push(letra[i])
}
else {
maximo = [...maximo, letra[i]]
}
}
}
return [...maximo]
}