gets a = gets.split.map(&:to_i).uniq.sort if a[1] n = 10000000 (1...a.length).each do |i| n = [n, a[i] - a[i-1]].min end p n else p 0 end