Datadog interview question

A few algorithm exercises to solve.