diff options
author | Guillermo Ramos | 2019-08-06 15:39:56 +0200 |
---|---|---|
committer | Guillermo Ramos | 2019-08-06 15:44:10 +0200 |
commit | f5ee0bc200f9f75654124b57c352fe5c965c122a (patch) | |
tree | 1aaf1d1b40bcf265ee47fc656ca5a2df6353f26f /020/ch1.pl | |
parent | da559bb53d8c4d3b46bb7c9f8679f00b9b529c6f (diff) | |
download | perlweekly-f5ee0bc200f9f75654124b57c352fe5c965c122a.tar.gz |
[020#1] MAXIMUM TRIMMING
Diffstat (limited to '020/ch1.pl')
-rwxr-xr-x | 020/ch1.pl | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -8,8 +8,6 @@ use strict; use warnings; -my $str = shift; - my @chunks; -push @chunks, $1 while $str =~ /((.)\2*)/g; +push @chunks, $& while $ARGV[0] =~ /(.)\1*/g; print "@chunks\n"; |