> For the complete documentation index, see [llms.txt](https://jgoodman8.gitbook.io/iron-data-science-notebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jgoodman8.gitbook.io/iron-data-science-notebook/algorithms-and-data-structures/binary/sum-of-two-integers.md).

# Sum of Two Integers

[https://leetcode.com/problems/sum-of-two-integers](https://leetcode.com/problems/sum-of-two-integers/submissions/)

{% hint style="warning" %}
Not working with negative values.&#x20;

TODO: Check how to deal with negative binary operations in Python
{% endhint %}

```
class Solution:
    def getSum(self, a: int, b: int) -> int:
        
        while b != 0:            
            carry = a&b
            a = a^b            
            b = carry<<1
            print(b)
            
        return a
```
