#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
bool isMajorityElement(vector<int>& nums, int target) {
int f = 0;
for(int num: nums)
if(target == num) f ++;
return f > nums.size() / 2;
}
};
int main() {
return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
bool isMajorityElement(vector<int>& nums, int target) {
vector<int>::iterator iter1 = lower_bound(nums.begin(), nums.end(), target);
vector<int>::iterator iter2 = upper_bound(nums.begin(), nums.end(), target);
return iter2 - iter1 > nums.size() / 2;
}
};
int main() {
return 0;
}