Problem 1074 · Hard
Fix a pair of rows, collapse the columns between them, and count subarrays with a prefix-sum table.
Open the interactive visualisation