Top-Interview-Questions--Leetcode icon indicating copy to clipboard operation
Top-Interview-Questions--Leetcode copied to clipboard

Majority Element

Open arushi-2298 opened this issue 3 years ago • 1 comments

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 avatar Oct 21 '21 16:10 arushi-2298

@arushi-2298 Please follow naming conventions.

KhushbooGoel01 avatar Oct 23 '21 21:10 KhushbooGoel01