forked from M3-Academy/challenge-algorithms-v2.0
feature/algoritmos #1
@ -1,4 +1,17 @@
|
||||
export function longestWords(words) {
|
||||
// implementar logica aqui
|
||||
|
||||
}
|
||||
// implementar logica aqui
|
||||
let max_string_size = 0;
|
||||
let big_string_list = [];
|
||||
|
||||
for (let string of words) {
|
||||
const string_size = string.length;
|
||||
|
||||
if (string_size > max_string_size) {
|
||||
big_string_list = [string];
|
||||
max_string_size = string_size;
|
||||
} else if (string_size == max_string_size) {
|
||||
big_string_list.push(string);
|
||||
}
|
||||
}
|
||||
return big_string_list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user