Skip to content

Commit 89d7656

Browse files
committed
Refactoring
1 parent 4e0ccae commit 89d7656

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

categories/euler/prob612-shlomif.p6

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ sub solve($myl)
7777
}
7878
say(@counts);
7979
my $ret = 0;
80-
for 0 ..^@counts -> $ik
80+
for 0 ..^@counts -> $i
8181
{
82-
my ($zi, $ni, $vi) = |@counts[$ik];
83-
for $ik ..^@counts -> $jk
82+
my ($zi, $ni, $vi) = |@counts[$i];
83+
for $i ..^@counts -> $j
8484
{
85-
my ($zj, $nj, $vj) = |@counts[$jk];
85+
my ($zj, $nj, $vj) = |@counts[$j];
8686
for 0 .. min($ni, $nj) -> $num_common
8787
{
8888
if ($num_common == 0 and (!$zi or !$zj))
@@ -98,7 +98,7 @@ sub solve($myl)
9898
next;
9999
}
100100
my $r = $vi * $vj * nCr(9, [$num_common, $i_num_diff, $j_num_diff]);
101-
if $ik == $jk
101+
if $i == $j
102102
{
103103
if $num_common == $ni
104104
{
@@ -110,7 +110,7 @@ sub solve($myl)
110110
$r *= 2;
111111
}
112112

113-
say ("num_common=", $num_common, "i=", $ik, "j=", $jk,
113+
say ("num_common=", $num_common, "i=", $i, "j=", $j,
114114
"r=", $r);
115115
$ret += $r;
116116
}

0 commit comments

Comments
 (0)