Big Oh Notation interview question

interview question asked in coding round from array