HubSpot interview question

They asked me to solve a leet code like problem. Was not too difficult.