Trains the technique from
LeetCode 3546Equal Sum Grid Partition IThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A field is surveyed as plot, a grid of parcels where plot[r][c] is the yield of one parcel. Every yield is at least 1.
The field is to be divided between two tenants by a single straight fence. The fence runs the whole way across the field, either along a line between two rows of parcels or along a line between two columns, and it never cuts through a parcel. Both sides must get at least one parcel.
Return true if some such fence gives the two sides the same total yield, and false otherwise.
Example 1
A fence between the two rows gives the top side 4 + 1 = 5 and the bottom side 2 + 3 = 5.
Example 2
A fence between the two columns gives the left side 3 + 2 = 5 and the right side 1 + 4 = 5.
Example 3
The whole field yields 8. The fence between the rows gives 3 and 5, and the fence between the columns gives 3 and 5, so no fence splits it evenly.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def can_split_plot(plot: list[list[int]]) -> bool:public boolean canSplitPlot(int[][] plot)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.