The Longest Consecutive Sequence problem asks us to find the length of the longest sequence of consecutive integers in an unsorted array.
While the brute force solution repeatedly searches for the next consecutive number, the optimal solution uses hashing to identify sequence starting points and build sequences efficiently.
Brute Force Approach
Intuition
For every number, keep checking whether the next consecutive number exists in the array.









