How many rectangles in a 3 by 4 grid?
A grid has 3 rows and 4 columns of unit squares (so 4 horizontal lines and 5 vertical lines).
How many rectangles, of all sizes, can be traced along the grid lines? Squares count. Then give the general formula for an m by n grid and check it on a 1 by 1 grid.
Show a hint
A rectangle is fixed by choosing two of the horizontal lines and two of the vertical lines.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
How many diagonals does a twenty-sided polygon have?Handshakes at a party of ten couplesPaths across a six-by-six gridHow many rectangles are on a chessboard?Two rooks that do not attack each other
All questions →