Solución
solution.tsTypeScript
function groupByLength(words: string[]): Record<number, string[]> {
// Escribe tu solución aquí
const groups: Record<number, string[]> = {};
for (const word of words) {
const len = word.length;
if (!groups[len]) groups[len] = [];
groups[len].push(word);
}
return groups;
}
// No modificar: necesario para evaluar el resultado.
export { groupByLength };0respuestas