$10K coding deathmatch

Paul Seamons paul at seamons.com
Wed Nov 1 14:04:47 MST 2006


Need to catch the following:

>  if ($diff > $size) {

   if ($diff && $diff > $size) {     

Because the difference must be in the range 1 .. n - 1

Paul Seamons

PS - unmaintainable solution in perl
perl -ne 'chop;@a=split;$n=grep{$t=abs($a[$_]-$a[$_-1]);!$t||$t>=@a}1..
$#a;print$n?"not a ":"","match\n"'



More information about the PLUG mailing list