Given an array, nums, having integers, return the majority element. An element will be considered a majority element if it occurs more than times in the array.
Note: It is safe to assume that the majority element always exists in the array.
Constraints
nums.lengthnums[i] Given an array, nums, having integers, return the majority element. An element will be considered a majority element if it occurs more than times in the array.
Note: It is safe to assume that the majority element always exists in the array.
Constraints
nums.lengthnums[i]