java 0ms 100% online submission - simple understanding
\nclass Solution {\n    public int getSum(int a, int b) {\n        \n        /*\n        xor (^) produces the sum result without condidering carry bit\n        
```\nclass Solution {\n    public int getSum(int a, int b) {\n        \n        /*\n        xor (^) produces the sum result without condidering carry bit\n        eg    2+3 = 5 (actual addition will be 0101)\n\t\t\n\t\tAnswer = Sum intermediate (part A) + carry ans (part B)\n        \n        0010\n        0011 (^ xor-ing)\n        ----\n        0001  part A - sum ans \n        ----\n        \n        and (&) produces the carry inducing bit positions\n\n        0010\n        0011 (& and-ing)\n        ----\n        0010  - carry intermediate\n        ----\n        \n        - left shifting to actual pos -> 0100 - part B - carry actual\n        \n        iterate again - with part A & part B until part B is 0 (means no carry value)\n        \n        A - sum value\n        B - carry value\n        \n        */\n        \n        \n        // stores intermediate sum\n        int xorSum = 0;\n        \n        // repeat until carry becomes 0\n        while(b!=0){\n            \n            // find sum temp result wihout carry || \n            xorSum = a ^ b;\n            \n            // find carry creating bit additions\n            b = a & b;\n            \n            // left shift to carry\'s actual place\n            b = b << 1;\n            \n            // reassign to a\n            a = xorSum;\n        }\n        return a;\n    }\n}\n```
['Java']