[Line 14](https://github.com/changjianzou/LeetCode/blob/e4d1cc4df836c40c6550464c9d9b9a184b80a972/Dynamical_Programming/Gas_Station.cpp#L14) (`min = min < sum ? min : sum;`) is incorrect. You would need to accumulate all negative difference and see if the last `sum` would compensate it.