/// https://leetcode.com/problems/majority-element/ class Solution { public: int majorityElement(vector& A) { int cand = A[0]; int count = 1; int n = A.size(); for(int i=1;in/2) return cand; else return -1; // return cand; } };