forked from M3-Academy/challenge-algorithms-v2.0
feat(mostUsedChar): fazendo funcão
This commit is contained in:
parent
401b1cc7ac
commit
0295676121
@ -1,4 +1,10 @@
|
|||||||
export function mostUsedChar(text) {
|
export function mostUsedChar(text) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
return ""
|
let textLower = text.toLowerCase().split("").sort();
|
||||||
|
for (let index = 1; index < textLower.length; index++) {
|
||||||
|
textLower = textLower.filter((e, i, a) => a.indexOf(e) !== i);
|
||||||
|
}
|
||||||
|
|
||||||
|
let letter = [...new Set(textLower)];
|
||||||
|
return letter.join("");
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user