Pregunta de entrevista de HubSpot

Algorithm question, hands-on project.