text: #include <gtest/gtest.h>
  #include <iostream>
  
  using namespace std;
  
  /**
   * This file is generated by leetcode_add.py v1.0
   *
   * 461.
   *      Hamming Distance
   *
   * ––––––––––––––––––––––––––––– Description –––––––––––––––––––––––––––––
   *
   *   The <a href="https://en.wikipedia.org/wiki/Hamming_distance"
   *   target="_blank">Hamming distance</a> between two integers is the
   *   number of positions at which the corresponding bits are
   *   Given two integers ‘x’ and ‘y’ , return “the “Hamming distance”
   *   between them” .
   *
   * ––––––––––––––––––––––––––––– Constraints –––––––––––––––––––––––––––––
   *
   *   • ‘0 ≤x, y ≤ 2³¹ - 1’
   *
   */
  
  struct q461 : public ::testing::Test {
    // Leetcode answer here
    class Solution {
     public:
      int hammingDistance(int x, int y) {
        return __builtin_popcount(x ^ y);
      }
    };
  
    class Solution *solution;
  };
  
  TEST_F(q461, sample_input01) {
    solution = new Solution();
    int x = 1;
    int y = 4;
    int exp = 2;
    EXPECT_EQ(solution->hammingDistance(x, y), exp);
    delete solution;
  }
  
  TEST_F(q461, sample_input02) {
    solution = new Solution();
    int x = 3;
    int y = 1;
    int exp = 1;
    EXPECT_EQ(solution->hammingDistance(x, y), exp);
    delete solution;
  }