merge all challenges #1

Merged
Gabriel_Lehmann merged 19 commits from development into master 2022-10-30 04:26:03 +00:00
Showing only changes of commit c7c04e054b - Show all commits

View File

@ -1,4 +1,18 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
let count = 0;
let char = " ";
let save = {};
text.split("").forEach((letter) => {
if(save[letter]){
save[letter] += 1;
} else {
save[letter] = 1;
}
if(save[letter] > count){
count = save[letter];
char = letter;
}
})
return char;
}