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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy