6 kyu
Multiples of 3 or 5
150,647 of 454,371jhoffner
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 a 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 | 789953 |
Total Skips | 64019 |
Total Code Submissions | 1282621 |
Total Times Completed | 454371 |
JavaScript Completions | 139212 |
CoffeeScript Completions | 466 |
Ruby Completions | 10974 |
Clojure Completions | 1136 |
Python Completions | 150647 |
C# Completions | 31658 |
Java Completions | 53133 |
Haskell Completions | 3328 |
C++ Completions | 28926 |
Elixir Completions | 865 |
TypeScript Completions | 8831 |
PHP Completions | 9152 |
Swift Completions | 3042 |
Go Completions | 7321 |
Rust Completions | 5469 |
C Completions | 13994 |
R Completions | 739 |
Nim Completions | 100 |
F# Completions | 336 |
Scala Completions | 1195 |
Lua Completions | 652 |
Shell Completions | 648 |
PowerShell Completions | 343 |
Crystal Completions | 69 |
NASM Completions | 76 |
Julia Completions | 274 |
Kotlin Completions | 3413 |
Racket Completions | 149 |
Dart Completions | 2090 |
Factor Completions | 36 |
Prolog Completions | 71 |
Raku Completions | 36 |
COBOL Completions | 54 |
CommonLisp Completions | 160 |
D Completions | 30 |
VB Completions | 68 |
Groovy Completions | 18 |
Total Stars | 3668 |
% of votes with a positive feedback rating | 88% of 40759 |
Total "Very Satisfied" Votes | 32183 |
Total "Somewhat Satisfied" Votes | 7759 |
Total "Not Satisfied" Votes | 817 |