forked from M3-Academy/challenge-algorithms-v2.0
feature/algoritmos #1
@ -1,4 +1,15 @@
|
||||
export function mostUsedChar(text) {
|
||||
// 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user