Longest Consecutive Sequence

Medium

📝 Description

Find the length of the longest consecutive elements sequence

Input Format

Unsorted array of integers

Output Format

Length of longest consecutive sequence

Constraints

0 ≤ nums.length ≤ 10^5

🔍 Sample Input

[100,4,200,1,3,2]
            

✅ Sample Output

4
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run