Pregunta de entrevista de Balad

it was mostly about the algorithmic thinking.