Top-Interview-Questions--Leetcode
Top-Interview-Questions--Leetcode copied to clipboard
Majority Element
Given an array A of N elements. Find the majority element in the array. A majority element in an array A of size N is an element that appears more than N/2 times in the array.
N = 5 A[] = {3,1,3,3,2} Output: 3 Explanation: Since, 3 is present more than N/2 times, so it is the majority element.
@arushi-2298 Please follow naming conventions.