• + 0 comments

    HAH! I did the exact same thing. Nice.

    		int n = in.nextInt();
            int j = 0;
            int max = 0;
            for(int i = 0; i < n; i++){
                int x = in.nextInt();
                if(x > max){
                    j = 1; max = x;
                }
                else if(x == max)
                    j++;
            }
            System.out.print(j);