use 5.38.0; use Test2::V0; use Path::Tiny; use File::Serialize; use Part2; my $input = path('input')->slurp; my $example = <%*; my $parsed = Part1::parse_input($example); #is [Part2::get_cycle('11A',$parsed->{directions},$parsed->{nodes})] => [1,2]; ##use DDP; my @x = Part2::get_cycle('22A',$parsed->{directions},$parsed->{nodes});p @x; #is [Part2::get_cycle('22A',$parsed->{directions},$parsed->{nodes})] => [1,2,3]; #is Part2::solution_2($example) => 6; $parsed = Part1::parse_input($input); # my @initial = grep { /A$/ } keys $parsed->{nodes}->%*; # for (@initial ) { # say join " ", Part2::get_cycle($_,$parsed->{directions},$parsed->{nodes}); # } is Part2::solution_2($input) => $solutions{2}; done_testing;