>_
majority_element.js
JavaScript 26.10
Not run yet

+ 7 hidden

Input
nums = [4, 7, 4, 4, 2]
Expected
4

4 sits at three of the five positions, and three is more than half of five.