<p>Given an integer array <strong>sorted</strong> in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time, return that integer.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> arr = [1,2,2,6,6,6,6,7,10]
<strong>Output:</strong> 6
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> arr = [1,1]
<strong>Output:</strong> 1
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= arr.length &lt;= 10<sup>4</sup></code></li>
	<li><code>0 &lt;= arr[i] &lt;= 10<sup>5</sup></code></li>
</ul>

class Solution:
    def findSpecialInteger(self, arr):
        n=len(arr)
        if n<3:
            return arr[0]
        s=n//4
        res=0
        massimo=0
        aggregati=[n//4, n//2,int(n//1.5)+1]
        x=0
        y=n-1
        for i in aggregati:
            l=0
            r=n-1
            m=(l+r)//2
            while l<=r:
                if m!=n-1 and arr[i]==arr[m+1]!=arr[m]:
                    x=m+1
                    break
                elif arr[i]<=arr[m]:
                    r=m-1
                else:
                    l=m+1
                m = (l + r) // 2
            l = 0
            r = n - 1
            m = (l + r) // 2
            while l<=r:
                if m!=0 and arr[i]==arr[m-1]!=arr[m]:
                    y=m-1
                    break
                elif arr[i]==arr[r]:
                    y=r
                    break
                elif arr[i]>=arr[m]:
                    l=m+1
                else:
                    r=m-1
                m = (l + r) // 2
            if ((1+y)-x)>massimo:
                massimo=(1+y-x)
                res=arr[i]
        return res
18200