Domanda di colloquio di Datadog

Question was algorithms-esque, pretty much LC medium