Motive interview question

about time complexity problem solving