750 Number Of Corner Rectangles
1. Question
Input: grid =
[[1, 0, 0, 1, 0],
[0, 0, 1, 0, 1],
[0, 0, 0, 1, 0],
[1, 0, 1, 0, 1]]
Output: 1
Explanation:
There is only one corner rectangle, with corners grid[1][2], grid[1][4], grid[3][2], grid[3][4].Input: grid =
[[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
Output: 9
Explanation:
There are four 2x2 rectangles, four 2x3 and 3x2 rectangles, and one 3x3 rectangle.2. Implementation
3. Time & Space Complexity
Last updated