Skip to content

Instantly share code, notes, and snippets.

@pieter
Created November 2, 2011 16:04
p DATA.read.split.inject(0) { |x,y| x + (y =~ /(\d+)-(\d+)/ ? ($2.to_i - $1.to_i + 1) : 1) }
__END__
1-99
101-108
177
214
241
259
323
361
388-389
402
412
414-416
420
425
429-432
435-442
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment