development #11

Merged
Daniel_Moliari_Barbosa merged 20 commits from development into master 2022-10-28 19:36:26 +00:00
Showing only changes of commit 77abbade21 - Show all commits

View File

@ -1,4 +1,16 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
const textObj = {}
let maxCount = 0
let mostUsedChar = ""
for (let char of text) {
textObj[char] = textObj[char] + 1 || 1
}
for (let key in textObj) {
if (textObj[key] > maxCount) {
maxCount = textObj[key]
mostUsedChar = key
}
}
return mostUsedChar
}