Google Interview Question

problem solving