Pergunta de entrevista da empresa Kaizen Gaming

What is the complexity of this algo?