Datadog interview question

2 straightforward coding problems, strings and graphs