Pergunta de entrevista da empresa Amazon

Time Complexity and space complexity.