Skip to content

Instantly share code, notes, and snippets.

@tomjadams
Forked from DylanFM/gist:70625
Created February 26, 2009 03:44
Show Gist options
  • Save tomjadams/70639 to your computer and use it in GitHub Desktop.
Save tomjadams/70639 to your computer and use it in GitHub Desktop.
Without the destructive update
# sans destructive update
def f(rss, n)
rss.inject(0) {|acc, rs| rs.include?(n) ? acc + 1 : acc}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment