2025 AoC Day 12 – Christmas Tree Farm

This is a solution to Advent of Code 2025 day 12, written in Raku.

https://adventofcode.com/2025/day/12

Part One

Consider the regions beneath each tree and the presents the Elves would like to fit into each of them. How many of the regions can fit all of the presents listed?

use Test;

sub part-one($input) {
    my @sections = $input.IO.split("\n\n");
    +@sections[*-1].lines.map(
        -> $line {
            my ($x,$y,@rest) = $line.comb(/\d+/);
            $x * $y > ([+] @rest.map(-> $n { $n * 8 }));
        }).grep(* == True);
}

is part-one('12-test.txt'), 2, 'test input';
say part-one('12-input.txt');
ok 1 - test input
437
raku