Pregunta de entrevista de Applied Intuition

The question was based on data structure and algorithm