Leetcode 750. Number Of Corner Rectangles
Given an m×n binary matrix, count how many axis-aligned rectangles have all four corner cells equal to 1. The core challenge is to efficiently count pairs of columns that contain 1s in the same two rows (or row-pairs sharing columns) and use combinatorics on those common columns to avoid brute-force O(m^2 n^2) checks.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.