Bloomberg interview question

Calculate time complexity of your algorithm