Even 13 year can understand


#1

int Solution::majorityElement(const vector &A) {
int n=A.size()/2;
for(int i=0;i<A.size();i++)
{if(count(A.begin(),A.end(),A[i])>n)
return A[i];}
}