6 kyu
Cumulative Triangle
156 of 1,426stephenyu
Description:
Imagine a triangle of numbers which follows this pattern:
- Starting with the number "1", "1" is positioned at the top of the triangle. As this is the 1st row, it can only support a single number.
- The 2nd row can support the next 2 numbers: "2" and "3"
- Likewise, the 3rd row, can only support the next 3 numbers: "4", "5", "6"
- And so on; this pattern continues.
1
2 3
4 5 6
7 8 9 10
...
Given N, return the sum of all numbers on the Nth Row:
1 <= N <= 10,000
Algorithms
Geometry
Similar Kata:
Stats:
Created | Feb 16, 2014 |
Published | Feb 17, 2014 |
Warriors Trained | 2337 |
Total Skips | 60 |
Total Code Submissions | 3520 |
Total Times Completed | 1426 |
Ruby Completions | 156 |
Python Completions | 732 |
JavaScript Completions | 408 |
Julia Completions | 32 |
Haskell Completions | 46 |
Groovy Completions | 25 |
C Completions | 150 |
COBOL Completions | 10 |
Total Stars | 45 |
% of votes with a positive feedback rating | 93% of 261 |
Total "Very Satisfied" Votes | 229 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 5 |