export function mostUsedChar(text) { // implementar logica aqui const total = text.split(""); let stringRepeat = {}; total.forEach((count) => { stringRepeat[count] = (stringRepeat[count] || 0) + 1; }) const maxVal = Math.max(...Object.values(stringRepeat)); const num = Object.keys(stringRepeat).find((key) => stringRepeat[key] === maxVal); return num; } console.log(mostUsedChar("fdgdfgff")) console.log(mostUsedChar("Lorem ipsum")) console.log(mostUsedChar("adsassdasd")) console.log(mostUsedChar("testeeeee"))