Amazon interview question

Online assessment hackerrank 2 coding problems