Count number of squares in a rectangle - GeeksforGeeks
Count number of squares in a rectangle
Given a m x n rectangle, how many squares are there in it?
Examples:
Input: m = 2, n = 2 Output: 5 There are 4 squares of size 1x1 + 1 square of size 2x2. Input: m = 4, n = 3 Output: 24 There are 16 squares of size 1x1 + 6 squares of size 2x2 + 2 squares of size 3x3.
Read full article from Count number of squares in a rectangle - GeeksforGeeks
No comments:
Post a Comment