Longest Consecutive Sequence – Leetcode 128 – JavaScript