Solución
solution.tsTypeScript
function countCapitalizedWords(text: string): number {
if (text.length == 0) return 0;
return (text.match(/[A-ZÁÉÍÓÚÜÑ]/g)??[]).length;
}
// No modificar: necesario para evaluar el resultado.
export { countCapitalizedWords };0respuestas