function checkSymmetric(matrix) {
let rows = matrix.length;
let cols = matrix[0].length;
if (rows != cols) {
return false;
}
for (let i = 0; i < rows; i++) {
for (let j = 0; j < cols; j++) {
if (matrix[i][j] != matrix[j][i]) {
return false;
}
}
}
return true;
}
const matrix = [[1, 2, 3],
[2, 3, 7],
[3, 7, 4]];
if (checkSymmetric(matrix)) {
console.log("yes")
}
else{
console.log("no")
}
/*
run:
"yes"
*/