You are given an integer array nums of size n.
Your task is to find the majority element, which is the element that appears more than ⌊n / 2⌋ times in the array.
It is guaranteed that a majority element always exists in the array.
Input: nums = [4,5,4]
Output: 4
Input: nums = [1,1,2,2,2,1,1]
Output: 1
Accepted:
Submission: