Amazon Interview Question

Such as simple solution to difficult task?