LC 0371 [M] Sum of Two Integers - ALawliet/algorithms GitHub Wiki

https://www.youtube.com/watch?v=gVUrDV4tZfY&ab_channel=NeetCode

class Solution {
    public int getSum(int a, int b) {
        while (b != 0) {
            int tmp = (a & b) << 1;
            a = a ^ b;
            b = tmp;
        }
        return a;
    }
}