Joined September 2013
·

Kaz Walker

Senior Developer at Foodee
·
Vancouver, Canada
·
·
·

I completely agree with this post, the more languages you know, typically, the better code you write in every language.

Problems like this are great examples of why I love the syntax of Ruby. The solution is incredibly easy and the code is very readable.

(0..999).select{|value| value % 3 == 0 || value % 5 == 0}.inject(0, :+)
# For the more wordy Rubyists:
(0..999).select{|value| value.modulo(3).zero? or value.modulo(5).zero?}.inject(0, :+)
Achievements
42 Karma
0 Total ProTip Views
Interests & Skills