I first found this problem when looking at a Yodle engineering challenge question.
Basically you this takes a file with lines of numbers and finds the largest sum by totaling the largest adjacent numbers for each new line.
triangle_array = []
f = File.open("triangle.txt", "r")
f.each_line do |line|
triangle_array << line.split.map(&:to_i)
end
f.close
lines = triangle_array.length
for i in (lines-2).downto(0).to_a do
for j in (i).downto(0).to_a do
triangle_array[i][j] += [triangle_array[i+1][j].to_i,triangle_array[i+1][j+1].to_i].max
end
end
p triangle_array[0][0]