Amazon Interview Question

puzzle-based logical reasoning