Commits

Shlomi Fish committed bcd87a0

Bug fix for the indices.

  • Participants
  • Parent commits 84c82f8

Comments (0)

Files changed (1)

File project-euler/152/euler-152.pl

             {
                 my @factors = sort {$a <=> $b } uniq (map {
                     my $i = $_;
-                    grep { (($masks->[$i]>>$_)&0x1) } @{$new_factors_contains[$i]}
+                    @{$new_factors_contains[$i]}[grep { (($masks->[$i]>>$_)&0x1) } keys(@{$new_factors_contains[$i]})]
                     } (0 .. $#$masks));
 
                 my $new_new_sum = $new_sum;