forked from M3-Academy/challenge-algorithms-v2.0
11 lines
320 B
JavaScript
11 lines
320 B
JavaScript
export function mostUsedChar(text) {
|
|
// implementar logica aqui
|
|
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("");
|
|
}
|