gets xs = gets.split.map(&:to_i).uniq.sort puts xs.map.with_index{|n,idx| n - xs[idx-1]}.drop(1).min || 0