2014年4月8日

摘要: Problem link:http://oj.leetcode.com/problems/gas-station/We can solve this problem by following algorithm. CompleteCircuit(gas, cost): let n be the number of stations // Check if there exists i such that A[i,n] >= 0 if (sum of gas) > (sum of cost) return -1 // There is no valid i such that A[. 阅读全文

posted @ 2014-04-08 08:27 卢泽尔 阅读(428) 评论(0) 推荐(0)