main idea: sum(gas[i] - cost[i]) is non-negative if solution exists. If solution exists, then a guaranteed valid starting point is index such that the cumulative sum of gas[i] - cost[i] values are at minimum.

note: the %len(gas) at the return statement is actually not required but its there for clarity.

```
class Solution(object):
def canCompleteCircuit(self, gas, cost):
"""
:type gas: List[int]
:type cost: List[int]
:rtype: int
"""
min_ind = 0
min_val = 0
val = 0
for i in xrange(len(gas)):
val += gas[i] - cost[i]
if val < min_val:
min_ind = i + 1
min_val = val
if val < 0:
return -1
return min_ind % len(gas)
```