Amazon Interview Question

two problem solving questions , they are not that hard