
Desicription
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
Your algorithm should run in O(n) complexity.
Example:
1 |
Input: [100, 4, 200, 1, 3, 2] |
Solution
1 |
class { |

Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
Your algorithm should run in O(n) complexity.
Example:
1 |
Input: [100, 4, 200, 1, 3, 2] |
1 |
class { |
近期评论