Pregunta de entrevista de Flipkart

One question based on array and another on tree