package leetcode;

/**
 * https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array/
 */
public class Problem1287 {
    public int findSpecialInteger(int[] arr) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1287 prob = new Problem1287();
        System.out.println(prob.findSpecialInteger(new int[]{1,2,2,6,6,6,6,7,10})); // 6
    }
}

@@ -187,220 +187,397 @@
     
-// TODO%0A        return 0;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1287 prob = new Problem1287();%0A        System.out.println(prob.findSpecialInteger(new int%5B%5D%7B1,2,2,6,6,6,6,7,10%7D)); // 6
+int n = (int) Math.ceil(arr.length * 0.25);%0A        int answer = 0;%0A        int count = 0;%0A        for (int i = 0; i %3C arr.length - 1; i++) %7B%0A            if (arr%5Bi%5D != arr%5Bi + 1%5D) %7B%0A                count = 0;%0A            %7D else %7B%0A                count++;%0A            %7D%0A            if (count %3E= n) %7B%0A                return arr%5Bi%5D;%0A            %7D%0A        %7D%0A        return arr%5Barr.length - 1%5D;
 %0A   

Solve problem 1287