Majority Element in an Array – LeetCode
Given an array of size n, find the majority element. The element that appears more than ⌊ n/2 ⌋ times in the array. Note: Input will be a non-empty and unsorted array. Example Solution Approach 1. Sorting On sorting the given array, the element occurring more than [n/2] times will… Read More »Majority Element in an Array – LeetCode