Splunk interview question

DFS problem, leetcode medium in 1 round, leetcode easy in 2 round