Majority Element — JavaScript easy interview problem
Given an array `nums` of size n, return the majority element — the element that appears more than ⌊n/2⌋ times. You may assume it always exists.
Tags: boyer-moore, voting
Practice this Arrays problem free in the JS Interview Playground with automated tests and unlockable solutions.