C++ One line using bitset


  • 0
    P

    '''class Solution {
    public:
    int hammingDistance(int x, int y) {
    return bitset<32>(x^y).count();
    }
    };
    '''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.