Just have an array the size of the highest possible numbers....and then for each cell in the array, just increment array2[array1[i]], then find the max of the 2nd array