Maior frequência

Published by Mubashir Hassan in

Dada uma string text. Escreva uma função que retorne o caractere com a maior frequência. Se mais de 1 caractere tiver a mesma maior frequência, retorne todos esses caracteres como um array. Se não houver repetição de caracteres, retorne "No Repetition".

Exemplos

maxOccur("Computer Science") ➞ ['e']

maxOccur("Edabit") ➞ "No Repetition"

maxOccur("system admin") ➞ ['m', 's']

maxOccur("the quick brown fox jumps over the lazy dog") ➞ [' ']

Observações

Tente usar o conceito empregado na ordenação por contagem.