Datadog Interview Question

Algorithms: DFS, string pattern matching