Skip to content

Commit 5449826

Browse files
committed
refactor(algorithms, greedy): gas stations
1 parent 2df4b2d commit 5449826

File tree

4 files changed

+18
-25
lines changed

4 files changed

+18
-25
lines changed
File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import unittest
2+
from typing import List
3+
from parameterized import parameterized
4+
from algorithms.greedy.gas_stations import can_complete_circuit
5+
6+
7+
class CanCompleteCircuitTestCase(unittest.TestCase):
8+
@parameterized.expand([
9+
([1,2,3,4,5],[3,4,5,1,2],3),
10+
([2,3,4],[3,4,3],-1),
11+
([1, 2],[2,1],1),
12+
])
13+
def test_can_complete_circuit(self, gas: List[int], cost: List[int], expected: int):
14+
actual = can_complete_circuit(gas, cost)
15+
self.assertEqual(expected, actual)
16+
17+
if __name__ == "__main__":
18+
unittest.main()

puzzles/arrays/gas_stations/test_gas_stations.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)