aboutsummaryrefslogtreecommitdiff
path: root/sum_two_integers.py
blob: 1ed3424b4c5744868e4c21fa6c80918bcdd6baf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 371. Sum of Two Integers

"""
given two integers 'a' and 'b', return the sum of the two integers without
using the operators '+' and '-'.
"""


class Solution(object):
    def getSum(self, a, b):
        """
        :type a: int
        :type b: int
        :rtype: int
        """
        ab = [a, b]
        return sum(ab)


if __name__ == "__main__":
    obj = Solution()
    print(obj.getSum(a=1, b=2))
    print(obj.getSum(a=2, b=3))