6 kyu
Squares in a Rectangle
689 of 1,499emaclean
Description:
A rectangle can be split up into a grid of 1x1 squares, the amount of which being equal to the product of the two dimensions of the rectangle. Depending on the size of the rectangle, that grid of 1x1 squares can also be split up into larger squares, for example a 3x2 rectangle has a total of 8 squares, as there are 6 distinct 1x1 squares, and two possible 2x2 squares. A 4x3 rectangle contains 20 squares.
Your task is to write a function `findSquares` that returns the total number of squares for any given rectangle, the dimensions of which being given as two integers with the first always being equal to or greater than the second.
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Jan 20, 2018 |
Published | Jan 20, 2018 |
Warriors Trained | 3470 |
Total Skips | 110 |
Total Code Submissions | 4002 |
Total Times Completed | 1499 |
JavaScript Completions | 508 |
Python Completions | 689 |
Java Completions | 251 |
R Completions | 60 |
Haskell Completions | 37 |
Ruby Completions | 44 |
COBOL Completions | 11 |
Total Stars | 55 |
% of votes with a positive feedback rating | 93% of 276 |
Total "Very Satisfied" Votes | 243 |
Total "Somewhat Satisfied" Votes | 29 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 4 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |