Sha256: 44cd44aab1bd8ee11847d2759e4ae2ce7b76f705dc8680631c5d94f463328042
Contents?: true
Size: 351 Bytes
Versions: 396
Compression:
Stored size: 351 Bytes
Contents
<?php /** * @param string $a * @param string $b * @return int distance */ function distance($a, $b) { if (strlen($a) !== strlen($b)) { throw new InvalidArgumentException('DNA strands must be of equal length.'); } return count( array_diff_assoc( str_split($a), str_split($b) ) ); }
Version data entries
396 entries across 396 versions & 1 rubygems