- or download this
sub lcs {
my($x, $y) = @_;
...
}
return $v[length($x) - 1][length($y) - 1];
}
- or download this
sub matchss {
my($ss, $str) = @_;
...
}
pop @state;
}
- or download this
sub lcscount {
my($x, $y) = @_;
...
);
$count;
}
- or download this
$count += $seen{$_} * matchss($_, $y) for keys %seen;