Pergunta de entrevista da empresa Datadog

2 straightforward coding problems, strings and graphs