Best solution and beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nXOR for adding two numb
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nXOR for adding two numbers and do & opration to find carry and left shifting the carry to the next bit and repeat the loop until there is no carry.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int getSum(int a, int b) {\n        int ans=0;\n        int carry=0;\n        while(b!=0){\n             ans=a^b;\n             carry=a&b;\n            carry=carry<<1;\n            a=ans;\n            b=carry;\n        }\n        return a;\n    }\n}\n```
['Math', 'Bit Manipulation', 'Java']