2025 Advent of Code Day 4 Part 2

Perl. Developed and tested with Perl 5.42.0. use v5 .42 ; my @grid ; open DATA, q/data/ ; while ( <DATA> ){ chomp ; push @grid , [ split // , $_ ]; } my @forklift_accessible ; { my @accessible = (); for my $i ( 0 .. @grid - 1 ){ my $row = $grid [ $i ]; for my $j ( 0 .. @ { $row } - 1 ){ if ( $row -> [ $j ] eq q/@/ ){ push @accessible , [ $i , $j ] if is_accessible( $i , $j , \ @grid ); } } } push…