Loading...
Given an array nums, return the majority element (appears more than n/2 times). The majority element always exists.
3,2,3
3
[3, 2, 3], which has a total of n=3 elements.3 appears twice, which is more than 1.5 times, so it is the majority element.3.