Datadog interview question

A leetcode easy and a leetcode medium