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.159 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.158 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.157 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.156 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.155 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.154 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.153 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.152 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.151 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.150 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.149 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.148 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.147 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.146 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.145 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.144 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.143 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.142 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.141 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm
trackler-2.2.1.140 tracks/elm/exercises/sum-of-multiples/SumOfMultiples.example.elm