Share my C++ solutions,easy to understand
class Solution {\n    public:\n        int getSum(int a, int b) {\n            int sum = a;\n            \n            while (b != 0)\n            {\n          
    class Solution {\n    public:\n        int getSum(int a, int b) {\n            int sum = a;\n            \n            while (b != 0)\n            {\n                sum = a ^ b;//calculate sum of a and b without thinking the carry \n                b = (a & b) << 1;//calculate the carry\n                a = sum;//add sum(without carry) and carry\n            }\n            \n            return sum;\n        }\n    };
['C++']