Amazon Interview Question

big o notation of the program written