6 kyu
Sum of many ints
55 of 2,965farzher
Description:
Write this function
for i from 1 to n
, do i % m
and return the sum
f(n=10, m=5) // returns 20 (1+2+3+4+0 + 1+2+3+4+0)
You'll need to get a little clever with performance, since n can be a very large number
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Jan 24, 2015 |
Published | Jan 24, 2015 |
Warriors Trained | 7931 |
Total Skips | 1424 |
Total Code Submissions | 34702 |
Total Times Completed | 2965 |
CoffeeScript Completions | 55 |
JavaScript Completions | 1202 |
Haskell Completions | 303 |
Python Completions | 1242 |
Ruby Completions | 269 |
R Completions | 39 |
Objective-C Completions | 30 |
COBOL Completions | 9 |
Total Stars | 219 |
% of votes with a positive feedback rating | 89% of 351 |
Total "Very Satisfied" Votes | 296 |
Total "Somewhat Satisfied" Votes | 36 |
Total "Not Satisfied" Votes | 19 |