Given a grid of size m n.
A partition is formed by making a single straight horizontal or vertical cut that divides grid into two non-empty rectangular subgrids.
You may optionally remove at most
The sum of values in both subgrids is equal after the optional cell removal.
If a cell is removed, the remaining cells in that subgrid must remain non-empty and form a single
Return true if there exists at least false otherwise.
Note: Two cells are considered connected if they share an edge.
Constraints:
m grid.length
n grid[i].length
m * n
grid[i][j]
Given a grid of size m n.
A partition is formed by making a single straight horizontal or vertical cut that divides grid into two non-empty rectangular subgrids.
You may optionally remove at most
The sum of values in both subgrids is equal after the optional cell removal.
If a cell is removed, the remaining cells in that subgrid must remain non-empty and form a single
Return true if there exists at least false otherwise.
Note: Two cells are considered connected if they share an edge.
Constraints:
m grid.length
n grid[i].length
m * n
grid[i][j]