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