Solución

@arkzado·3/5/2026TypeScript
solution.tsTypeScript
function uniqueWords(text: string): string[] {

  if(text.length === 0) return [];
  
  const dictionary: Record<string, number> = {};
  const words: string[] = text.split(/\s+/).map(w => w.toLowerCase())

  for(let word of words){
    dictionary[word] ??= 0;
    dictionary[word] += 1;
  }
  return Object.keys(dictionary).filter(w => dictionary[w] === 1);
}

// Do not modify: needed to evaluate the result.
export { uniqueWords };
0respuestas
Respuestas

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.