10.Greedy
Problems
For a greedy problem such as Gas Station, the local optimum is the global optimum, so the starting station cannot be on the path of a partially done route. e.g. the previous starting station is i, and the furthest station is j, where j - i < n - 1, the next possible staring station cannot be any station between i and j. We resume searching from j + 1, which is the key for a O(N) solution.