My LeetCode grinding. Trying to do a problem a day.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

problem.txt 384B

12345678910111213141516171819
  1. The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
  2. Given two integers x and y, calculate the Hamming distance.
  3. Note:
  4. 0 ≤ x, y < 231.
  5. Example:
  6. Input: x = 1, y = 4
  7. Output: 2
  8. Explanation:
  9. 1 (0 0 0 1)
  10. 4 (0 1 0 0)
  11. ↑ ↑
  12. The above arrows point to positions where the corresponding bits are different.