Skip to content

Instantly share code, notes, and snippets.

@eric1234
Created October 8, 2009 02:29
Show Gist options
  • Select an option

  • Save eric1234/204649 to your computer and use it in GitHub Desktop.

Select an option

Save eric1234/204649 to your computer and use it in GitHub Desktop.
Problem 5 on Project Euler
class Numeric
def divisible_by? num
self % num == 0
end
end
possible = increment = 20 * 19
test = (11..18).to_a.reverse
loop do
if test.all? {|d| possible.divisible_by? d}
puts possible
exit
end
possible += increment
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment