feature/algoritmos #1

Merged
FilipeQuintanilha merged 10 commits from feature/algoritmos into master 2022-10-28 16:03:10 +00:00
Showing only changes of commit 04c26faffd - Show all commits

View File

@ -1,4 +1,15 @@
export function longestWords(words) {
// implementar logica aqui
let maior = 0;
for (const palavra of words){
if (palavra.length > maior)
maior = palavra.length;
}
const arr = [];
words.map(element=>{
if (element.length === maior)
arr.push(element);
})
return arr;
}