Datadog interview question

Leetcode medium not too bad