Pregunta de entrevista de Block Gemini

optimising/creating an algorithm based on scenario given