You are on page 1of 1

t Rt

6,5,3,1,3,4,3
1 4 +3
3,4,3,2
-1

series = [6,5,3,1,3,4,3]
lens = series.length
lens.times do |a|
lens.times do |b|
profit = series[a] - series[b]
if profit > 0 and a > b then
print b,"\t", a,"\t", profit, "\n"
end
end
end

3
2
3
4
3

4
5
5
5
6

2
1
3< 3 5
1
2

You might also like