Optimal Algorithmic Approach
HashSet: skip non-sequence-starts to ensure each element is visited at most twice total.
Core Invariants & Edge Cases
- Insert all numbers into a HashSet
- Only start counting from a number n where n-1 is NOT in the set
- Extend the streak by checking n+1, n+2, … in the set