Bijak interview question

Print array elements with there frequency in sorted order O(N)