J.P. Morgan interview question

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