Pregunta de entrevista de ShipBob

Leetcode easy problem with follow-ups increasing the difficulty to medium and hard