2022-10-27 15:07:13 +00:00
|
|
|
export function mostUsedChar(text) {
|
|
|
|
// implementar logica aqui
|
2022-10-31 17:01:27 +00:00
|
|
|
const charHolder = text.toLowerCase().split('').reduce((ac,a) => (ac[a] = ac[a] + 1 || 1, ac), {});
|
|
|
|
|
|
|
|
let max = Math.max(...Object.values(charHolder));
|
|
|
|
|
|
|
|
return Object.entries(charHolder).reduce((ac,[k,v]) =>v === max ? ac + k : ac, '');
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|