Pergunta de entrevista da empresa KSquare Solutions

What's the complexity of this algorithm? (after finishing a programming test the interviewer asked me to do)