Largest product in a grid: Difference between revisions
m
→{{header|Python}}
Line 323:
from math import prod
def maxproduct(mat,
""" find the largest product of len length horizontal or vertical length in matrix """
length, nrow, ncol = nlen - 1, len(mat), len(mat[0])
maxprod, maxrow, maxcol, arr = 0, [0, 0], [0, 0], [0]
for row in range(nrow):
Line 340:
maxprod, maxrow, maxcol, arr = pro, row, [col, col2], mat[row][col:col2]
print(f"The max {
MATRIX = [
Line 369:
</lang>{{out}}
<pre>
The
The
The
The
</pre>
=={{header|Raku}}==
|