<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 {
public:
    int findSpecialInteger(vector<int>& arr) {
        int count = ceil(arr.size()*1.0/4);
        int c = 1;
        int ans;

        for (int i=0;i<arr.size() - 1;i++) {
            if (arr[i] == arr[i+1]) {
                cout<<c<<" "<<arr[i]<<endl;
                c++;
            } else {
                if (c >= count) {
                    ans = arr[i];
                }
                                    c = 1;

            }
        }

        if (c >= count) {

                    ans = arr[arr.size() -1 ];
                    c = 1;
                }

                return ans;
    }
};
15300