Amazon interview question

Basic cs questions not that hard