Question d’entretien chez Microsoft

Array question based on simple maths DFS graph question