Mega Code Archive
Categories
/
Ruby
/
Array
Sum of word lengths
%w[pea queue are].inject(0) {|total, word| total + word.length } # => 11