DEV Community

Discussion on: LeetCode: Majority Element (Boyer-Moore Majority Voting Algorithm)

Collapse
 
isurumax26 profile image
Isurumax26

I think sorting approach is incorrect.

Example :
Input: nums = [1, 1, 2, 3]
Output: 2 but should be 1