Domanda di colloquio di Spyke Games

What is the time complexity of this code?