Amazon Interview Question

pattern recognition