tanchukw

Untitled

Aug 6th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.16 KB | None | 0 0
  1. class Solution {
  2. public:
  3.     int majorityElement(vector<int>& nums) {
  4.         sort(nums.begin(), nums.end());
  5.         return nums[nums.size() / 2];
  6.     }
  7. };
Advertisement
Add Comment
Please, Sign In to add comment