class Solution {

public:

int majorityElement(vector<int>& nums) {

```
for(int i=0;i<nums.size();i++)
{ //int index=nums[i];
int counter=0;
for(int j=i;j<nums.size();j++)
{ if (nums[j]==nums[i])
counter++;
}
if (counter>floor(nums.size()/2))
return nums[i];
}
}
```

};