Skip to content

Instantly share code, notes, and snippets.

@mdemare
Created November 12, 2009 21:52
Show Gist options
  • Save mdemare/233326 to your computer and use it in GitHub Desktop.
Save mdemare/233326 to your computer and use it in GitHub Desktop.
text.split("\n").
reject {|l| l =~ /^#/}.
map {|l| l.split.size }.
select {|l| l.odd? }.
inject(0) {|sum,i| sum+i }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment