You are given an m n integer matrix grid.
Determine whether it is possible to make either a single horizontal cut or a single vertical cut to partition grid into two non empty rectangular sections such that the sum of the elements in both sections is equal.
Return true if such a partition is possible, or false otherwise.
Constraints:
m grid.length
n grid[i].length
m n
grid[i][j]
You are given an m n integer matrix grid.
Determine whether it is possible to make either a single horizontal cut or a single vertical cut to partition grid into two non empty rectangular sections such that the sum of the elements in both sections is equal.
Return true if such a partition is possible, or false otherwise.
Constraints:
m grid.length
n grid[i].length
m n
grid[i][j]