Simple Java solution with explanation - Most efficient
Below is the logic using the bitwise operators to get the sum of two integers.\n\n\nclass Solution {\n    public int getSum(int a, int b) {\n\t//Sum of two bits
Below is the logic using the bitwise operators to get the sum of two integers.\n\n```\nclass Solution {\n    public int getSum(int a, int b) {\n\t//Sum of two bits can be obtained by performing XOR (^) operation of two bits.\n\t//Carry bit can be obtained by performing AND (&) operation of two bits\n        while(b != 0) {\n            int carry = a & b;\n            a = a ^ b;\n            b = carry << 1;            \n        }\n        return a;        \n    }\n}\n```\n
[]