Enumerate Separate Target-Sum Regions

Asked at WisdomAI · Coding Questions · Difficulty: Hard · Last asked Nov 2, 2026

Given a rectangular grid of nonnegative integers, find every axis-aligned rectangle whose cells add up to a target. Return every unordered pair of those rectangles that shares no cell. The result must be complete and deterministic, even when zero-valued cells produce many rectangles with the same sum.

Loading the problem…