Pergunta de entrevista da empresa Amadeus

Was asked to find the time complexity of a program