Google Interview Question

Sum3 problem