Duolingo interview question

questions about time/space complexity for some code