forked from M3-Academy/challenge-algorithms-v2.0
parent
ff6187b0df
commit
9729792910
@ -1,11 +1,4 @@
|
||||
export function longestWords(words) {
|
||||
let longest = "";
|
||||
|
||||
for (const word of words) {
|
||||
if (word.length > longest.length) {
|
||||
longest = word;
|
||||
}
|
||||
}
|
||||
|
||||
return words.filter((word) => word.length === longest.length);
|
||||
}
|
||||
// implementar logica aqui
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user