576. Sequence of Elements
Rohit requires assistance in finding the length of the longest consecutive sequence in an unsorted array. Help him by providing the solution to this problem. Given an array of integers called 'nums', print the length of the longest consecutive sequence.
The first line contains an integer N, which represents the size of the array. The second line contains the elements of the array as integers.
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