From 3e113b9370761d8c47f3e3326c1c990b80e7b3b8 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Wed, 28 Feb 2018 12:24:00 -0500 Subject: [PATCH] Working solution --- 2016/19/1.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 2016/19/1.pl diff --git a/2016/19/1.pl b/2016/19/1.pl new file mode 100644 index 0000000..d30208f --- /dev/null +++ b/2016/19/1.pl @@ -0,0 +1,13 @@ +use 5.20.0; + +my $input = 3004953; + +my @elves = 1..$input; + +while( @elves > 1 ) { + say $elves[0]; + push @elves, shift @elves; + shift @elves; +} + +say @elves;