Pergunta de entrevista da empresa Bloomberg

Calculate time complexity of your algorithm