Comviva Interview Question

sort integer array based on frequency