Amazon interview question

Basic hacker rank online problems