Google Interview Question

Leetcode type question- Graph DFS.