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