Amazon Interview Question

gas station problem and max path sum in binary tree