Pergunta de entrevista da empresa Expedia Group

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