Pregunta de entrevista de Meta

Data structure/algo based question