Majority Element at Microsoft
Easy66.1% acceptance
This problem has 75.0% frequency at Microsoft.
Problem Description
Given an array `nums` of size `n`, return _the majority element_. The majority element is the element that appears more than `⌊n / 2⌋` times. You may assume that the majority element always exists in the array.
Read full problem and hintsTopics
Also asked at 21 companies
More Microsoft Questions
Two SumEasyLRU CacheMediumLongest Substring Without Repeating CharactersMediumMedian of Two Sorted ArraysHardContainer With Most WaterMedium
View all Microsoft questions