Easy loop solution without +,- operator and not bitwise easy to understand 0ms
\n {:style=\'width:200px\'}\n\n\n# Intuition\nwhen we add two number we just increase the other by one and decrease other by 0\n\n# Approach\njust use a loop ke
\n![Screenshot 2023-10-22 at 9.53.07\u202FPM.png](https://assets.leetcode.com/users/images/c4ef6402-5a02-478c-9802-47a3e6e0987a_1697992071.9053872.png) {:style=\'width:200px\'}\n\n\n# Intuition\nwhen we add two number we just increase the other by one and decrease other by 0\n\n# Approach\njust use a loop keep on decreasing until it reaches equivalent to the sum if b is negative\nvice verse keep on increasing\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\n    public int getSum(int a, int b) \n    {\n        if(b>0)\n        {\n            for(int i=0;i<b;i++)\n            {\n                a++;\n            }\n        }\n        else if (b<0)\n        {\n            for(int i=0;i>b;i--)\n            {\n                a--;\n            }\n            \n        }\n        return a;\n        \n        \n    }\n}\n\n\n\n\n```
['Java']