Datadog interview question

Previous projects, leetcode - easy-medium difficulty