class Solution { public int solution(int[] array) { int[] count = new int[1001]; int answer = 0; for(int i : array){ count[i]++; } int max = 0; int max_num = 0; int max_count = 0; for(int i = 0; i max ){ max = count[i]; max_num = i; max_count = 1; } else if(count[i] == max){ max_count++; } if(max_count == 1){ answer = max_num; } else { answer = -1; } } return ..