Domanda di colloquio di J.P. Morgan

Given an array of integers sort the array based on frequency of elements.