Skip to content

Commit 8fb8b71

Browse files
committed
Fixed to calculate correctly for any size matrix (not only square)
1 parent 5bbb80c commit 8fb8b71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hard/matrix_determinant.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function fillMatrix(matrix, arrElements) {
6060
}
6161

6262
arrElements.forEach((element, index) => {
63-
const rowIndex = Math.floor(index / rows);
63+
const rowIndex = Math.floor(index / columns);
6464
const colIndex = index % columns;
6565
matrix[rowIndex][colIndex] = element;
6666
});

0 commit comments

Comments
 (0)