Datadog interview question

Deep dive into a project I worked on. One DFS leetcode, one array problem.