Given an matrix, you are allowed to perform the following operation any number of times:
Select any two adjacent cells in matrix and multiply both values by
Two cells are adjacent if they share a common edge horizontally or vertically.
Return the maximum possible sum of all elements in matrix after applying the operation any number of times.
Constraints:
n matrix.length matrix[i].length
n
matrix[i][j]
Given an matrix, you are allowed to perform the following operation any number of times:
Select any two adjacent cells in matrix and multiply both values by
Two cells are adjacent if they share a common edge horizontally or vertically.
Return the maximum possible sum of all elements in matrix after applying the operation any number of times.
Constraints:
n matrix.length matrix[i].length
n
matrix[i][j]