Adobe interview question

Algorithm complexity