Staircase of Stones
A pyramid is built in rows: the top row has 1 stone, the next row 3 stones, then 5, 7, and so on (odd numbers). Return the total number of stones needed for a pyramid of rows rows.
Example 1
rows 3
returns 9
1 + 3 + 5 = 9.
Constraints
0 <= rows <= 1000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Steps to Reduce to ZeroBeginner
- Sum of Consecutive PowersBeginner
- Sum of DivisorsBeginner
- Sum of MultiplesBeginner
- Type of TriangleBeginner
- Add Minutes to a ClockEasy
- Add StringsEasy
- Add Two Numbers in Base KEasy