Amazon interview question

Basic time complexity problems, alongside some simple coding