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

128.Longest Consecutive Sequence #21

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

128.Longest Consecutive Sequence #21

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

Comments

@soulhat
Copy link
Owner

soulhat commented Sep 26, 2020

Given an unsorted array of integers, find the length of the longest consecutive elements sequence.

Your algorithm should run in O(n) complexity.

Example:

Input: [100, 4, 200, 1, 3, 2]
Output: 4
Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4.
@soulhat soulhat added the enhancement New feature or request label Sep 26, 2020
@soulhat soulhat self-assigned this Sep 26, 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