2022-10-27 15:07:13 +00:00
|
|
|
export function mostUsedChar(text) {
|
|
|
|
// implementar logica aqui
|
2022-10-31 13:27:30 +00:00
|
|
|
|
|
|
|
let max = 0;
|
|
|
|
let maxCaracter = "";
|
|
|
|
|
|
|
|
text.split('').forEach((caracter) => {
|
|
|
|
if (text.split(caracter).length > max) {
|
|
|
|
max = text.split(caracter).length;
|
|
|
|
|
|
|
|
maxCaracter = caracter;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return maxCaracter;
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|