Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

169.Majority Element #8

Open
soulhat opened this issue Sep 25, 2020 · 0 comments
Open

169.Majority Element #8

soulhat opened this issue Sep 25, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@soulhat
Copy link
Owner

soulhat commented Sep 25, 2020

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.

You may assume that the array is non-empty and the majority element always exist in the array.

Example 1:

Input: [3,2,3]
Output: 3

Example 2:

Input: [2,2,1,1,1,2,2]
Output: 2
@soulhat soulhat added the enhancement New feature or request label Sep 25, 2020
@soulhat soulhat self-assigned this Sep 25, 2020
@soulhat soulhat changed the title Majority Element 169.Majority Element Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant