Solve the gas station problem by like solving max sum array problem.