8 my ($x1, $y1, $x2, $y2) = /(\d+),(\d+) -> (\d+),(\d+)/;
9 # say " $x1, $y1 -> $x2, $y2";
10 my $xi = $x2 > $x1 ? 1 : $x2 == $x1 ? 0 : -1;
11 my $yi = $y2 > $y1 ? 1 : $y2 == $y1 ? 0 : -1;
14 my ($x, $y) = ($x1, $y1);
17 $count++ if ++$p->{$x}->{$y} == 2;
19 } while ($x != $x2+$xi || $y != $y2+$yi);