Amazon Interview Question

What is the Big O for this algorithm