adventofcode/07/1.pl
Yanick Champoux 88fc836bd5 day07
2017-12-07 12:29:08 -05:00

16 lines
271 B
Perl

use 5.20.0;
use experimental qw/ smartmatch /;
my %prog;
while(<>) {
my( $name, @deps ) =
map { split ', ' } /(\S+).*?-> (.*)/;
$prog{$name} = \@deps;
}
my @all_deps = map { @$_ } values %prog;
say $_
for grep { not $_ ~~ @all_deps } keys %prog;