Pregunta de entrevista de Shopify

Adding some complexity to the initial problem after completing the code