Longest Consecutive Sequence | Javascript | Leetcode