Datadog interview question

Complexity of algorithms given