Datadog Interview Question

2 straightforward coding problems, strings and graphs