Datadog interview question

2nd phase are 2 leet code style challenges