Amazon Interview Question

General coding online coding test.