Pergunta de entrevista da empresa Bayview Asset Management

What's the time complexity of this algorithm you just described