Microsoft Interview Question

Given an integer array, where over half the values in the array are the same value, return that value in O(N) time.

Interview Answer

Anonymous

Mar 6, 2016

int[] array = {2,3,2,3,4,2,2,3,3,2,2}; int max =0; HashMap hash = new HashMap(); for(int i=0;i

1