Skip to content

Commit b4ac443

Browse files
Move Gas station problem to algorithms problem
1 parent 47220c6 commit b4ac443

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

LeetcodeProblems/Algorithms/GasStation/test-cases.js

-7
This file was deleted.

LeetcodeProblems/Algorithms/GasStation/index.js renamed to LeetcodeProblems/Algorithms/Gas_Station.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ var canCompleteCircuit = function(gas, cost) {
4747

4848
return result;
4949
};
50-
module.exports = canCompleteCircuit;
50+
51+
module.exports.canCompleteCircuit = canCompleteCircuit;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const assert = require("assert");
2+
const canCompleteCircuit = require("../../LeetcodeProblems/Algorithms/Gas_Station").canCompleteCircuit;
3+
4+
function test() {
5+
assert.equal(3, canCompleteCircuit([1,2,3,4,5], [3,4,5,1,2]));
6+
assert.equal(-1, canCompleteCircuit([1,2,3,4], [2,3,4,5]));
7+
assert.equal(0, canCompleteCircuit([8,2,3,4], [2,3,4,5]));
8+
}
9+
10+
module.exports.test = test;
11+

0 commit comments

Comments
 (0)