forked from M3-Academy/challenge-algorithms-v2.0
09-resolvido
This commit is contained in:
parent
70196f39a7
commit
fddd3bd930
@ -1,4 +1,12 @@
|
||||
export function mostUsedChar(text) {
|
||||
// implementar logica aqui
|
||||
return ""
|
||||
}
|
||||
// implementar logica aqui
|
||||
let max = 0;
|
||||
let mostRep = "";
|
||||
text.split("").forEach(function (index) {
|
||||
if (text.split(index).length > max) {
|
||||
max = text.split(index).length;
|
||||
mostRep = index;
|
||||
}
|
||||
});
|
||||
return mostRep;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user