Practice Equal Sum Grid Partition II
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Determine whether one horizontal or vertical cut can divide grid into two nonempty sections with equal sums, either immediately or after discounting at most one cell in total from either section. If a cell is discounted, the remaining cells in its section must stay connected through up, down, left, and right moves. Return whether such a partition exists.
Source: Equal Sum Grid Partition II on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
grid = [[1,4],[2,3]]
true
# Example 2
grid = [[1,2],[3,4]]
true
# Example 3
grid = [[1,2,4],[2,3,5]]
false
# Example 4
grid = [[4,1,8],[3,2,6]]
false
Constraints
Related LeetCode Problems
Practice more problems similar to Equal Sum Grid Partition II.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.