Sha256: 031fdc72f04bf31f6d0ccf530bba5a66c072a163fcd49e23b85b9e472a28e12f

Contents?: true

Size: 255 Bytes

Versions: 44

Compression:

Stored size: 255 Bytes

Contents

package summultiples

func MultipleSummer(divisors ...int) func(int) int {
	return func(limit int) int {
		sum := 0
		for i := 1; i < limit; i++ {
			for _, d := range divisors {
				if i%d == 0 {
					sum += i
					break
				}
			}
		}
		return sum
	}
}

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
trackler-2.0.1.2 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.1.1 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.1.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.10 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.9 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.8 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.7 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.6 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.5 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.4 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.3 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.2 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.1 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.0.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-1.0.4.1 tracks/go/exercises/sum-of-multiples/example.go
trackler-1.0.4.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-1.0.3.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-1.0.2.1 tracks/go/exercises/sum-of-multiples/example.go
trackler-1.0.2.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-1.0.1.2 tracks/go/exercises/sum-of-multiples/example.go