Google Interview Question

an alternate version of the max sum path problem