Amazon Interview Question

Hackerrank OA and SJT test.