Datadog Interview Question

Coding Interviews: Pattern matching, arrays, DFS