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