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.5.7 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.6 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.5 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.4 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.3 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.2 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.1 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.5.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.4.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.9 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.8 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.7 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.6 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.5 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.4 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.3 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.2 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.1 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.3.0 tracks/go/exercises/sum-of-multiples/example.go
trackler-2.0.2.0 tracks/go/exercises/sum-of-multiples/example.go