Sha256: 10ea12b1e6f0f51410a8152e65538f4324a8bc4a7f7d5002e4b025a2a538115a

Contents?: true

Size: 335 Bytes

Versions: 66

Compression:

Stored size: 335 Bytes

Contents

module SumOfMultiples exposing (sumOfMultiples)


sumOfMultiples : List Int -> Int -> Int
sumOfMultiples multiples limit =
    List.sum (List.filter (inMultiples multiples) (List.range 1 (limit - 1)))


inMultiples : List Int -> Int -> Bool
inMultiples multiples candidate =
    List.any (\factor -> candidate % factor == 0) multiples

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.179 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.178 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.177 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.176 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.175 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.174 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.173 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.172 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.171 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.170 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.169 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.167 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.166 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.165 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.164 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.163 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.162 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.161 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.160 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm