Solución
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