From: Jan "Yenya" Kasprzak Date: Fri, 12 Dec 2025 05:49:35 +0000 (+0100) Subject: Day 12: look at the input X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;ds=inline;p=aoc.git Day 12: look at the input --- diff --git a/2025/23.pl b/2025/23.pl new file mode 100755 index 0000000..374a385 --- /dev/null +++ b/2025/23.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl -w + +use v5.42; +use List::Util qw(sum); + +my $sum; + +while (<>) { + next if !/x/; + my ($w, $h, @nshapes) = /\d+/g; + + $w = int($w/3); + $h = int($h/3); + my $s = sum @nshapes; + $sum++ if $s <= $w*$h; +} + +say $sum;