http://www.perlmonks.org?node_id=1012912


in reply to reducing the number of lines

This has fewer lines:

if($l<$k){ if($s_rev[$d+1]==0 && $k-2>0){$s_rev[$d+1] = $k-2; } $h=$s[ +$b] == 0 ? 0 : $s[$b]-1; $s[$b1] = max($k,$lt); ....

I suspect -- no, know damn well -- that it's not helpful. However, the fact is, since I'm in no position to guess what your inputs are like, nor to intuit your actual goal, ...well, it's the best I can do for now.

Please, update with more details (data sample, narrative intent)!