Amazon interview question

Time Complexity and space complexity.