Pergunta de entrevista da empresa Media.net

How would you reduce a time complexity for a simple problem?