Amazon interview question

regular algorithm questions