Last active
August 29, 2015 13:56
-
-
Save s2t2/8815845 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def multiples_of_x_less_than_y(x, y) | |
(1..(y / x)).to_a.map {|z| x * z} | |
end | |
(multiples_of_x_less_than_y(3,80) + multiples_of_x_less_than_y(5,80)).uniq.sort.sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment