6 kyu
Multiples of 3 or 5
147,919 of 447,502jhoffner
Description:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Finish the solution so that it returns the sum of all the multiples of 3 or 5 below the number passed in.
Additionally, if the number is negative, return 0.
Note: If the number is a multiple of both 3 and 5, only count it once.
Courtesy of projecteuler.net (Problem 1)
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Mar 21, 2013 |
Published | Mar 28, 2013 |
Warriors Trained | 777203 |
Total Skips | 63307 |
Total Code Submissions | 1265989 |
Total Times Completed | 447502 |
JavaScript Completions | 137305 |
CoffeeScript Completions | 465 |
Ruby Completions | 10922 |
Clojure Completions | 1134 |
Python Completions | 147919 |
C# Completions | 31272 |
Java Completions | 52367 |
Haskell Completions | 3310 |
C++ Completions | 28408 |
Elixir Completions | 856 |
TypeScript Completions | 8598 |
PHP Completions | 9057 |
Swift Completions | 3015 |
Go Completions | 7170 |
Rust Completions | 5373 |
C Completions | 13774 |
R Completions | 733 |
Nim Completions | 97 |
F# Completions | 333 |
Scala Completions | 1188 |
Lua Completions | 637 |
Shell Completions | 632 |
PowerShell Completions | 337 |
Crystal Completions | 68 |
NASM Completions | 75 |
Julia Completions | 271 |
Kotlin Completions | 3355 |
Racket Completions | 147 |
Dart Completions | 2039 |
Factor Completions | 36 |
Prolog Completions | 69 |
Raku Completions | 35 |
COBOL Completions | 53 |
CommonLisp Completions | 154 |
D Completions | 28 |
VB Completions | 64 |
Groovy Completions | 16 |
Total Stars | 3609 |
% of votes with a positive feedback rating | 88% of 40416 |
Total "Very Satisfied" Votes | 31900 |
Total "Somewhat Satisfied" Votes | 7706 |
Total "Not Satisfied" Votes | 810 |