From ac71df84182b9ed15f633c12d4cbaaad071a810b Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 1 Dec 2021 13:24:24 -0500 Subject: Solve day 1 part 1 --- 2021/day01.pl | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 2021/day01.pl (limited to '2021') diff --git a/2021/day01.pl b/2021/day01.pl new file mode 100644 index 0000000..f4ab273 --- /dev/null +++ b/2021/day01.pl @@ -0,0 +1,6 @@ +my $last, $incs; +while (<>) { + $incs++ if ($last && $_ > $last); + $last = $_; +} +print "$incs\n"; -- cgit 1.4.1