develop #11

Merged
nicolasrosadeoliveira merged 20 commits from develop into master 2022-10-29 19:56:35 +00:00
Showing only changes of commit f207e8a5cd - Show all commits

View File

@ -1,4 +1,19 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
}
let result = '';
let mostUsedCount = 0;
for (const letter of text) {
let countLetter = 0;
for (const letterToCount of text) {
if (letterToCount === letter) {
countLetter++;
}
}
if (countLetter > mostUsedCount) {
mostUsedCount = countLetter;
result = letter;
}
}
return result;
}