Persistent Systems Interview Question

Display frequency of each distinct number in a given array