6 kyu
Multiples of 3 or 5
149,476 of 451,481jhoffner
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 | 784606 |
Total Skips | 63719 |
Total Code Submissions | 1275460 |
Total Times Completed | 451481 |
JavaScript Completions | 138405 |
CoffeeScript Completions | 466 |
Ruby Completions | 10952 |
Clojure Completions | 1135 |
Python Completions | 149476 |
C# Completions | 31508 |
Java Completions | 52835 |
Haskell Completions | 3320 |
C++ Completions | 28698 |
Elixir Completions | 860 |
TypeScript Completions | 8738 |
PHP Completions | 9118 |
Swift Completions | 3030 |
Go Completions | 7254 |
Rust Completions | 5424 |
C Completions | 13912 |
R Completions | 737 |
Nim Completions | 100 |
F# Completions | 335 |
Scala Completions | 1193 |
Lua Completions | 645 |
Shell Completions | 637 |
PowerShell Completions | 341 |
Crystal Completions | 69 |
NASM Completions | 75 |
Julia Completions | 272 |
Kotlin Completions | 3384 |
Racket Completions | 149 |
Dart Completions | 2070 |
Factor Completions | 36 |
Prolog Completions | 70 |
Raku Completions | 35 |
COBOL Completions | 54 |
CommonLisp Completions | 157 |
D Completions | 30 |
VB Completions | 67 |
Groovy Completions | 18 |
Total Stars | 3648 |
% of votes with a positive feedback rating | 88% of 40616 |
Total "Very Satisfied" Votes | 32065 |
Total "Somewhat Satisfied" Votes | 7737 |
Total "Not Satisfied" Votes | 814 |