2014-11-14 08:57:29 +00:00
|
|
|
def multiples_of_three_and_five_below(n)
|
2014-12-05 00:50:52 +00:00
|
|
|
(3..n-1).select { |i| (i % 3 == 0) || (i % 5 == 0) }
|
2014-11-14 08:57:29 +00:00
|
|
|
end
|
|
|
|
|
2014-12-05 00:50:52 +00:00
|
|
|
def solution
|
|
|
|
multiples_of_three_and_five_below(1000).inject(:+)
|
|
|
|
end
|