Skip to content

Instantly share code, notes, and snippets.

@jaredcacurak
Created February 24, 2011 02:32
Show Gist options
  • Select an option

  • Save jaredcacurak/841649 to your computer and use it in GitHub Desktop.

Select an option

Save jaredcacurak/841649 to your computer and use it in GitHub Desktop.
A Groovy solution for Project Euler - Problem 2
def list = [0, 1]
while (list.last() < 4000000) {
list << list[-1] + list[-2]
}
list.findAll { it % 2 == 0 }.sum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment