re: Project Euler #2 - Even Fibonacci numbers VIEW POST

VIEW FULL DISCUSSION
 

Ruby✨💎✨

puts Enumerator.new { |y|
  f1, f2 = 0, 1
  f1, f2 = f1 + f2, f1 while y << f1
}.take_while {|x| x <= 4_000_000 }.select(&:even?).sum
code of conduct - report abuse