diff options
| -rw-r--r-- | challenge-282/kjetillll/perl/ch-1.pl | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/challenge-282/kjetillll/perl/ch-1.pl b/challenge-282/kjetillll/perl/ch-1.pl index 2c05780024..34665cf223 100644 --- a/challenge-282/kjetillll/perl/ch-1.pl +++ b/challenge-282/kjetillll/perl/ch-1.pl @@ -1,13 +1,7 @@ use strict; use warnings; use Test::More tests=>3; sub good_int { - ( - grep length==3, - split / /, - shift =~ s/(.)\1*/$& /gr - )[0] - // - -1 + shift =~ s/(.)\1*/$& /gr =~ /\b\d{3}\b/x ? $& : -1 } is good_int(12344456) => "444"; |
