Expedia Group Interview Question

What is the time complexity of the solution to the programming question.