LeetCode: Gas Station

Approach 2: DP approach