Skip to content

Instantly share code, notes, and snippets.

@gmuller
Created October 4, 2011 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmuller/1260813 to your computer and use it in GitHub Desktop.
Save gmuller/1260813 to your computer and use it in GitHub Desktop.
Another solution for the algorithm problem
def getValue(x, y)
return 1 if x == y
return 0 if x < 0 || y < 0 || y > x
return getValue(x-1, y-1) + getValue(x-1, y)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment