Cyzerg interview question

1. Sort the Array based on the frequency.