diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..7981158 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,17 @@ export function longestWords(words) { - // implementar logica aqui - -} \ No newline at end of file + // 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; +}