[LeetCode] Gas Station,转化为求最大序列的解法,和更简单简单的Jump解法。
LeetCode上 Gas Station是比较经典的一题,它的魅力在于算法足够优秀的情况下,代码可以简化到非常简洁的程度。
原题如下
Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a
转载
2016-03-11 18:08:29 ·
333 阅读 ·
0 评论