class Yukicoder def initialize n = gets.chomp.to_i x = gets.chomp.split(' ').map(&:to_i).uniq.sort min_value = Float::INFINITY x.each_cons(2) do |a,b| min_value = [min_value, b-a].min end puts (min_value == Float::INFINITY)? 0 : min_value end end Yukicoder.new