s

Code Golf: Grid Computing

Aug 31, 2008

Here is my submission for the Grid Computing challenge. Code size: 135 bytes.

a=[]
10.times{|x|a<<gets.split}
y=[0]*20
10.times{|i|a.each{|x|y[i]+=x[i].to_i}}
a.each{|x|x.each{|i|y[a.index(x)+10]+=i.to_i}}
p y.max

Tagged: rubycode golf