feature/algoritmos #1

Merged
caroline_moran merged 12 commits from feature/algoritmos into master 2022-10-28 13:25:52 +00:00
Showing only changes of commit 967448340a - Show all commits

View File

@ -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;
}