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

Version Path
trackler-2.2.1.143 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.142 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.141 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.140 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.139 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.138 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.137 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.136 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.135 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.134 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.133 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.132 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.131 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.130 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.129 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.128 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.127 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.126 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.125 tracks/powershell/exercises/hamming/hamming-example.ps1
trackler-2.2.1.124 tracks/powershell/exercises/hamming/hamming-example.ps1