Skip to content

Instantly share code, notes, and snippets.

@hassox
Forked from DylanFM/gist:70625
Created February 26, 2009 03:36
Show Gist options
  • Select an option

  • Save hassox/70633 to your computer and use it in GitHub Desktop.

Select an option

Save hassox/70633 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