Sha256: 1368059522c28d376a2d13e0979f360149bb7415c4127ce8a14421aa6210bb65
Contents?: true
Size: 343 Bytes
Versions: 92
Compression:
Stored size: 343 Bytes
Contents
package summultiples const testVersion = 2 // 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
92 entries across 92 versions & 1 rubygems