Skip to content

Commit 44a2f92

Browse files
authored
Update gas_station.py
1 parent 1c838c7 commit 44a2f92

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

data_structures/arrays/gas_station.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
class Solution:
22
def can_omplete_circuit(self, gas: list[int], cost: list[int]) -> int:
33
"""
4-
Determines the starting gas station index from which you can complete the circuit,
5-
or returns -1 if it's not possible.
6-
4+
Finds the starting station index to complete the circuit,
5+
or returns -1 if not possible.
76
Args:
87
gas (List[int]): List of gas available at each station.
98
cost (List[int]): List of gas costs to travel to the next station.
10-
119
Returns:
1210
int: The index of the starting station, or -1 if no solution exists.
13-
1411
Examples:
1512
>>> solution = Solution()
1613
>>> solution.can_omplete_circuit([1, 2, 3, 4, 5], [3, 4, 5, 1, 2])

0 commit comments

Comments
 (0)