1 line, 0 ms Java
The code is as follows.\n\npublic class Solution {\n    public int getSum(int a, int b) {\n        return b == 0 ? a : getSum(a ^ b, (a & b) << 1);\n    }\n}\n\
The code is as follows.\n```\npublic class Solution {\n    public int getSum(int a, int b) {\n        return b == 0 ? a : getSum(a ^ b, (a & b) << 1);\n    }\n}\n```\nThe above code may be rewritten to make it more readable.\n```\npublic class Solution {\n    public int getSum(int a, int b) {\n        while (b != 0) {\n            int c = ((a & b) << 1);\n            a ^= b;\n            b = c;\n        }\n        return a;\n    }\n}\n```\n`c` stands for the carry bit of adding two integers. The sum of two integers can be decomposed into a summation bit (`a & b`) and a carry bit (`a ^ b`). The `<< 1` is to set the carry bit to the correct bit. The above process is repeated until no carry (`c`, stored in `b`, becomes 0). Then the sum is stored in `a`.
[]