How to Find the difference between highest & lowest occurring elements in an array ?

[Question]: In given array find difference between lowest & highest occurrence elements . For Example: Array :  [5,4,5,5,6,9,5,6] O/P = 2. because 5 appears 4 times & element 6 is 2 times. difference is 2.