Flipkart interview question

problems based on graph and sorting technique