MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / next

Method next

134. Gas Station/Solution.cpp:17–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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.

Callers 8

seatMethod · 0.45
leaveMethod · 0.45
seatMethod · 0.45
minimum_movesMethod · 0.45
basicFunction · 0.45
count_continuousMethod · 0.45
roman_to_intMethod · 0.45

Calls

no outgoing calls

Tested by 1

basicFunction · 0.36