Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

added Maximal_square_Test.js file #74

Merged
merged 1 commit into from
Oct 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Maximal_square_Test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const assert = require('assert');
const {Maximalsquare } = require('../LeetcodeProblems/Maximal_square');

function test1() {
var matrix = [
[1, 0, 1, 0, 0],
[1, 0, 1, 1, 1],
[1, 1, 1, 1 1],
[1, 0, 0, 1, 0],
]

assert.strictEqual(Maximalsquare(matrix), 4);
}

function test2() {
var matrix = [
[0, 1],
[1,0]
]

assert.strictEqual(Maximalsquare(matrix), 1);
}

function test3(){
var matrix = [
[0]
]
assert.strictEqual(Maximalsquare(matrix), 0);
}

function test() {
test1();
test2();
test3();
}

module.exports.test = test