Pergunta de entrevista da empresa Amazon

Time complexity analysis and improvement.