6 kyu
Multiples of 3 or 5
137,253 of 447,296jhoffner
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 | 776812 |
Total Skips | 63292 |
Total Code Submissions | 1265535 |
Total Times Completed | 447296 |
JavaScript Completions | 137253 |
CoffeeScript Completions | 465 |
Ruby Completions | 10915 |
Clojure Completions | 1133 |
Python Completions | 147845 |
C# Completions | 31267 |
Java Completions | 52338 |
Haskell Completions | 3309 |
C++ Completions | 28394 |
Elixir Completions | 855 |
TypeScript Completions | 8591 |
PHP Completions | 9053 |
Swift Completions | 3014 |
Go Completions | 7162 |
Rust Completions | 5370 |
C Completions | 13766 |
R Completions | 733 |
Nim Completions | 97 |
F# Completions | 331 |
Scala Completions | 1188 |
Lua Completions | 636 |
Shell Completions | 630 |
PowerShell Completions | 336 |
Crystal Completions | 68 |
NASM Completions | 75 |
Julia Completions | 271 |
Kotlin Completions | 3354 |
Racket Completions | 146 |
Dart Completions | 2037 |
Factor Completions | 36 |
Prolog Completions | 69 |
Raku Completions | 35 |
COBOL Completions | 53 |
CommonLisp Completions | 153 |
D Completions | 28 |
VB Completions | 63 |
Groovy Completions | 16 |
Total Stars | 3609 |
% of votes with a positive feedback rating | 88% of 40409 |
Total "Very Satisfied" Votes | 31896 |
Total "Somewhat Satisfied" Votes | 7703 |
Total "Not Satisfied" Votes | 810 |