HubSpot interview question

On-site Coding: easy leetcode-style arrays problem