development #1
@ -1,4 +1,12 @@
|
||||
export function longestWords(words) {
|
||||
// implementar logica aqui
|
||||
|
||||
}
|
||||
return words.reduce((acc, val, ind) => {
|
||||
if (!ind || acc[0].length < val.length) {
|
||||
return [val];
|
||||
}
|
||||
if (acc[0].length === val.length) {
|
||||
acc.push(val);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user