euler/ruby/euler053.rb

12 lines
168 B
Ruby
Raw Normal View History

2014-11-20 21:54:55 +00:00
require_relative 'euler'
def solution
result = 0
(1..100).each do |n|
(1..n).each do |k|
result += 1 if n.choose(k) > 1000000
end
end
result
end