| 15 | int n; |
| 16 | |
| 17 | int next(int i) { |
| 18 | return i + 1 == n ? 0 : i + 1; |
| 19 | } |
| 20 | |
| 21 | //If car starts at A and can not reach B. Any station between A and B can not reach B.(B is the first station that A can not reach.) |
| 22 | //If the total number of gas is bigger than the total number of cost. There must be a solution. |
no outgoing calls