2ms c++ solution


  • 0
    S

    class Solution {
    public:
    int getSum(int a, int b) {
    while(a&b){
    int temp = a;
    a = (temp & b)<<1;
    b = temp ^ b;
    }
    return a|b;
    }
    };


Log in to reply
 

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