Sha256: 803b54f7abb80b043b58c33236d229d336f3902207b66d623f9dff9cc23d99e3
Contents?: true
Size: 320 Bytes
Versions: 199
Compression:
Stored size: 320 Bytes
Contents
package summultiples // SumMultiples returns the sum of the multiples of the given divisors // up to, but not including, the given limit. func SumMultiples(limit int, divisors ...int) (sum int) { for i := 1; i < limit; i++ { for _, d := range divisors { if i%d == 0 { sum += i break } } } return }
Version data entries
199 entries across 199 versions & 1 rubygems