From daadd18fa2ac9800274ff5c5edf307d9d769f874 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Mon, 4 Dec 2017 20:20:16 -0500 Subject: [PATCH] day10 --- 2015/10/repeat.pl | 12 ++++++++++++ 2015/10/repeat2.pl | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 2015/10/repeat.pl create mode 100644 2015/10/repeat2.pl diff --git a/2015/10/repeat.pl b/2015/10/repeat.pl new file mode 100644 index 0000000..bcc8a8f --- /dev/null +++ b/2015/10/repeat.pl @@ -0,0 +1,12 @@ +use 5.20.0; + +my $s = <>; +chomp $s; +say $s; + + +$s =~ s/(.)\1*/ length($&) . $1 /eg for 1..40; + +say $s; +say length $s; + diff --git a/2015/10/repeat2.pl b/2015/10/repeat2.pl new file mode 100644 index 0000000..6fc7cda --- /dev/null +++ b/2015/10/repeat2.pl @@ -0,0 +1,10 @@ +use 5.20.0; + +my $s = <>; +chomp $s; +say $s; + +$s =~ s/(.)\1*/ length($&) . $1 /eg for 1..50; + +say length $s; +