Lybrate Interview Question

algorithm for depth first search