Check the problem statement here:

https://leetcode.com/problems/majorit... Python for beginners: https://www.youtube.com/watch?v=egq7Z...

Code:

class Solution:

def majorityElement(self, nums: List[int]) -> int:

nums.sort();

return nums[len(nums)//2];

https://leetcode.com/problems/majorit... Python for beginners: https://www.youtube.com/watch?v=egq7Z...

Code:

class Solution:

def majorityElement(self, nums: List[int]) -> int:

nums.sort();

return nums[len(nums)//2];

## 0 Comments:

## Post a Comment