Solve Me First

  • + 0 comments

    Bit shifting:

    int solveMeFirst(int a, int b) {
        while (b != 0) {
            int carry = a & b;
            a = a ^ b;
            b = carry << 1;
        }
    
        return a;
    }