Dsa
Arrays
Medium
Consecutive Sequence Length
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
Input Format:
- A single line with space-separated integers.
Output Format:
- A single integer representing the length of the longest consecutive sequence.
Example:
Input:
100 4 200 1 3 2
Output:
4
Key concepts
arrayssortinghashing
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now