542. Longest Consecutive Sequence
Rohit requires assistance in finding the length of the longest consecutive sequence in an unsorted array of integers, nums.
The first line of input contains an integer N, representing the size of the array. The second line contains N space-separated integers, forming the array.
Print the length of the longest consecutive elements sequence.
6 200 100 4 1 2 3
1 <= N <= 10^5 -10^4 <= nums[i] <= 10^4