Skip to content

Commit

Permalink
[Math] Refactor solution to Hamming Distance
Browse files Browse the repository at this point in the history
  • Loading branch information
soapyigu authored Aug 9, 2019
1 parent b144b76 commit 2d1cd0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Math/HammingDistance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class HammingDistance {
var z = x ^ y, count = 0

while z > 0 {
count = z & 1 == 1 ? count + 1 : count
count += z & 1
z = z >> 1
}

return count
}
}
}

0 comments on commit 2d1cd0e

Please sign in to comment.