Intuit interview question

I was asked time and space complexity on my first coding challenge solution