5 my @nums = sort { $a <=> $b } <>;
8 my %is_listed = map { $_ => 1 } @nums;
10 for my $i (0 .. $#nums-1) {
11 for my $j ($i .. $#nums) {
12 my $rest = 2020-$nums[$i]-$nums[$j];
13 if ($rest > 0 && $is_listed{$rest} && $rest != $nums[$i]
14 && $rest != $nums[$j]) {
15 print "$nums[$i]*$nums[$j]*$rest=", $nums[$i]*$nums[$j]*$rest, "\n";