AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
54
var assert = require('assert');
function is_toeplitz_matrix(matrix) {
//fill in
return matrix
}
try {
assert.equal(is_toeplitz_matrix([
[1, 2, 3, 4],
[5, 1, 2, 3],
[9, 5, 1, 2]
]), true);
console.log('PASSED: ' + "is_toeplitz_matrix([[1,2,3,4],[5,1,2,3],[9,5,1,2]]) should return `true`");
} catch (err) {
console.log(err);
}
try {
assert.equal(is_toeplitz_matrix([
[1, 2, 3],
[4, 1, 2],
[5, 4, 1]
]), true);
console.log('PASSED: ' + "is_toeplitz_matrix([[1,2,3],[4,1,2],[5,4,1]]) should return `true`");
OUTPUT
Results will appear here.