This problem is the first of its series. The initial thought might be from each node, check the consecutive sequence starting from itself. However, this will result in TLE because it’s O(n) time complexity. How can we improve? We don’t actually need to recalculate for each node. We only need to keep track of the current length of this consecutive sequence. When we see a new node, if it’s +1 to previous value, we add one to length; otherwise, we reset length to 1.