feature/algoritmos #1

Merged
FilipeQuintanilha merged 10 commits from feature/algoritmos into master 2022-10-28 16:03:10 +00:00
Showing only changes of commit 1d5a1c0007 - Show all commits

View File

@ -1,4 +1,15 @@
export function mostUsedChar(text) { export function mostUsedChar(text) {
// implementar logica aqui // implementar logica aqui
return "" let max = 0;
let maxChar = "";
const splitLetras = text.split("");
splitLetras.map( char=> {
const splitCaracter = text.split(char);
if (splitCaracter.length > max) {
max = splitCaracter.length;
maxChar = char;
}
});
return maxChar;
} }