Pergunta de entrevista da empresa Datadog

A few algorithm exercises to solve.