Big Oh Notation Interview Question

interview question asked in coding round from array