6 kyu
Multiples of 3 or 5
136,311 of 443,957jhoffner
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 | 770633 |
Total Skips | 62948 |
Total Code Submissions | 1257443 |
Total Times Completed | 443957 |
JavaScript Completions | 136311 |
CoffeeScript Completions | 465 |
Ruby Completions | 10891 |
Clojure Completions | 1128 |
Python Completions | 146635 |
C# Completions | 31067 |
Java Completions | 51928 |
Haskell Completions | 3284 |
C++ Completions | 28142 |
Elixir Completions | 850 |
TypeScript Completions | 8480 |
PHP Completions | 8992 |
Swift Completions | 3001 |
Go Completions | 7075 |
Rust Completions | 5316 |
C Completions | 13654 |
R Completions | 729 |
Nim Completions | 97 |
F# Completions | 327 |
Scala Completions | 1186 |
Lua Completions | 629 |
Shell Completions | 622 |
PowerShell Completions | 333 |
Crystal Completions | 68 |
NASM Completions | 74 |
Julia Completions | 271 |
Kotlin Completions | 3332 |
Racket Completions | 144 |
Dart Completions | 2010 |
Factor Completions | 36 |
Prolog Completions | 69 |
Raku Completions | 34 |
COBOL Completions | 52 |
CommonLisp Completions | 148 |
D Completions | 28 |
VB Completions | 63 |
Groovy Completions | 16 |
Total Stars | 3582 |
% of votes with a positive feedback rating | 88% of 40240 |
Total "Very Satisfied" Votes | 31764 |
Total "Somewhat Satisfied" Votes | 7670 |
Total "Not Satisfied" Votes | 806 |