6 kyu
Multiples of 3 or 5
138,787 of 452,737jhoffner
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 | 786832 |
Total Skips | 63851 |
Total Code Submissions | 1278672 |
Total Times Completed | 452737 |
JavaScript Completions | 138787 |
CoffeeScript Completions | 466 |
Ruby Completions | 10964 |
Clojure Completions | 1135 |
Python Completions | 149952 |
C# Completions | 31565 |
Java Completions | 52965 |
Haskell Completions | 3325 |
C++ Completions | 28813 |
Elixir Completions | 863 |
TypeScript Completions | 8783 |
PHP Completions | 9132 |
Swift Completions | 3034 |
Go Completions | 7285 |
Rust Completions | 5443 |
C Completions | 13948 |
R Completions | 738 |
Nim Completions | 100 |
F# Completions | 336 |
Scala Completions | 1194 |
Lua Completions | 647 |
Shell Completions | 640 |
PowerShell Completions | 341 |
Crystal Completions | 69 |
NASM Completions | 75 |
Julia Completions | 273 |
Kotlin Completions | 3392 |
Racket Completions | 149 |
Dart Completions | 2079 |
Factor Completions | 36 |
Prolog Completions | 70 |
Raku Completions | 36 |
COBOL Completions | 54 |
CommonLisp Completions | 159 |
D Completions | 30 |
VB Completions | 67 |
Groovy Completions | 18 |
Total Stars | 3657 |
% of votes with a positive feedback rating | 88% of 40686 |
Total "Very Satisfied" Votes | 32118 |
Total "Somewhat Satisfied" Votes | 7752 |
Total "Not Satisfied" Votes | 816 |