Given an array nums of size n, return the majority element.
The majority element is the element that appears more than floor(n / 2) times. You may assume the majority element always exists in the array.
Input: nums = [3, 2, 3] Output: 3 Explanation: 3 appears 2 times out of 3, which is more than floor(3/2) = 1.
Input: nums = [2, 2, 1, 1, 1, 2, 2] Output: 2 Explanation: 2 appears 4 times out of 7, which is more than floor(7/2) = 3.
1 <= nums.length <= 5 * 10^4-10^9 <= nums[i] <= 10^9nums = [3, 2, 3]