Sha256: 492aa316b06cc3d9171119deb56449512b1ddd8c5ab7e093c13383092af2cdae
Contents?: true
Size: 284 Bytes
Versions: 155
Compression:
Stored size: 284 Bytes
Contents
object SumOfMultiples { def sum(factors: Set[Int], limit: Int): Int = { def isDivisibleBy(x: Int)(y: Int): Boolean = x % y == 0 def isMultiple(x: Int): Boolean = factors exists isDivisibleBy(x) val multiples = (1 until limit) filter isMultiple multiples sum } }
Version data entries
155 entries across 155 versions & 1 rubygems