chomp(my $params_num = ); chomp(my $params_line = ); my @params = split(/\s/, $params_line); @params = keys %{{ map {$_ => 1} @params }}; @params = sort {$a <=> $b} @params; my $times = scalar(@params)-1; my $short; for (my $i = 0; $i < $times; $i++) { my $len = $params[$i + 1] - $params[$i]; $short = ($short > $len || !defined($short)) ? $len : $short; } print ((defined($short) ? $short : 0) . "\n");