sub match { my $sum = 0; for my $l ('A'..'Z') { my $acount = 0; ++$acount while($aa =~ /$l/g); my $bcount = 0; ++$bcount while($bb =~ /$l/g); $sum += abs($acount-$bcount); } return $sum; }
In reply to Re^2: The sum of absolute differences in the counts of chars in two strings.
by trizen
in thread The sum of absolute differences in the counts of chars in two strings.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |