17 lines
346 B
JavaScript
17 lines
346 B
JavaScript
export function mostUsedChar(text) {
|
|
// implementar logica aqui
|
|
|
|
let max = 0;
|
|
let maxCaracter = "";
|
|
|
|
text.split('').forEach((caracter) => {
|
|
if (text.split(caracter).length > max) {
|
|
max = text.split(caracter).length;
|
|
|
|
maxCaracter = caracter;
|
|
}
|
|
});
|
|
|
|
|
|
return maxCaracter;
|
|
} |