Paycom Interview Question

Find the max duplicated number in an array. For example a=[1,4,8,2,1,7,4,1] Return 1