Comviva interview question

sort integer array based on frequency