Sha256: 7b675e5fdcfcedccbf5a04b3d46191e874d8662eced89453b04dc283b0b19951
Contents?: true
Size: 362 Bytes
Versions: 360
Compression:
Stored size: 362 Bytes
Contents
function Compute([string]$strand1, [string]$strand2) { if ( $strand1.length -ne $strand2.length) { Throw "Mismatching string lengths" } $first = [char[]][string]$strand1 $second = [char[]][string]$strand2 $result = 0 for ($i=0; $i -lt $first.length; $i++) { if ( $first[$i] -ne $second[$i] ) { $result += 1 } } return $result }
Version data entries
360 entries across 360 versions & 1 rubygems