feat(09): finished

This commit is contained in:
Matheus Brollo Dauter 2022-11-02 10:13:47 -03:00
parent c220c97b54
commit c9e9d4a2e0

View File

@ -1,4 +1,13 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
let maxLetter = 0;
let mostUsed = '';
text.split('').forEach((letter) => {
if (text.split(letter).length > maxLetter) {
maxLetter = text.split(letter).length - 1;
mostUsed = letter;
}
})
return mostUsed;
}