feature #1

Merged
wellingtonCarlos merged 11 commits from feature into master 2022-11-02 18:10:07 +00:00
Showing only changes of commit 61b8dc538c - Show all commits

View File

@ -1,4 +1,28 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
const palavra = {};
let maximo = 0;
let repetido = '';
for(let letra of text){
if(palavra[letra]){
palavra[letra]++;
}else{
palavra[letra] = 1;
}
}
for(let letra in palavra){
if(palavra[letra] > maximo){
maximo = palavra[letra];
repetido = letra;
}
}
return repetido
}