Skip to content

Instantly share code, notes, and snippets.

@s2t2
Last active August 29, 2015 13:56
Show Gist options
  • Save s2t2/8815845 to your computer and use it in GitHub Desktop.
Save s2t2/8815845 to your computer and use it in GitHub Desktop.
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