arrs = [6, 5, 3, 1, 3, 4, 3]
max_diff_val = nil
min_val = nil
t1 = Time.now
arrs.each_with_index do |val, index|
  min_val = val if index == 0
  max_diff_val = val - min_val
  min_val = val if val < min_val
  cal_i += 1
end
puts max_diff_val