Pregunta de entrevista de Comviva

sort integer array based on frequency