Skip to content

Instantly share code, notes, and snippets.

@DylanFM
Forked from lachlanhardy/gist:70614
Created February 26, 2009 03:19
Show Gist options
  • Save DylanFM/70625 to your computer and use it in GitHub Desktop.
Save DylanFM/70625 to your computer and use it in GitHub Desktop.
def f(ra,n)
ra.inject(0) { |r,x| r += 1 if x.include? n; r }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment