Skip to content

Commit 84d148f

Browse files
kav1239ignacio-chiazzo
authored andcommitted
added Maximal_square_Test.js file
1 parent 9669bf8 commit 84d148f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Maximal_square_Test.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const assert = require('assert');
2+
const {Maximalsquare } = require('../LeetcodeProblems/Maximal_square');
3+
4+
function test1() {
5+
var matrix = [
6+
[1, 0, 1, 0, 0],
7+
[1, 0, 1, 1, 1],
8+
[1, 1, 1, 1 1],
9+
[1, 0, 0, 1, 0],
10+
]
11+
12+
assert.strictEqual(Maximalsquare(matrix), 4);
13+
}
14+
15+
function test2() {
16+
var matrix = [
17+
[0, 1],
18+
[1,0]
19+
]
20+
21+
assert.strictEqual(Maximalsquare(matrix), 1);
22+
}
23+
24+
function test3(){
25+
var matrix = [
26+
[0]
27+
]
28+
assert.strictEqual(Maximalsquare(matrix), 0);
29+
}
30+
31+
function test() {
32+
test1();
33+
test2();
34+
test3();
35+
}
36+
37+
module.exports.test = test

0 commit comments

Comments
 (0)