Javascript | Bit Manipulation


  • 0
    var getSum = function(a, b) {
        while (b !== 0) {
            var carry = a & b;
            a = a ^ b;
            b = carry << 1;
        }
        return a;
    };
    

Log in to reply
 

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