Pregunta de entrevista de Safaricom

A question on data structures and algorithms