Solución
solution.tsTypeScript
export function mostFrequentChar(text: string): string {
const myMap = new Map();
for(const c of text){
myMap.set(c, (myMap.get(c) ?? 0) +1)
}
return Array.from(myMap.keys()).sort(
(a,b)=>myMap.get(b)-myMap.get(a)
)[0]
}0respuestas