in reply to PPGA - Prolog-Perl Golf Association: Run-length encoding
update: err.. 51sub rle { my$c;map{shift;$c++;$_[0]ne$_?("$_*$c",$c=0)[0]:()}@_ }
sub rle { my$c;map{shift;$c++;$_[0]ne$_?"$_*$c"|($c=''):()}@_ }
MeowChow s aamecha.s a..a\u$&owag.print
|
---|