Bloomberg interview question

(after solving the problem) What is the computational complexity in big-O notation?