LeetCode-Python-371. 两整数之和

不使用运算符 + 和 -  ,计算两整数  a 、b  之和。

示例 1:

输入: a = 1, b = 2
输出: 3

示例 2:

输入: a = -2, b = 3
输出: 1
class Solution(object):
    def getSum(self, a, b):
        """
        :type a: int
        :type b: int
        :rtype: int
        """
        return sum([a,b])
        

猜你喜欢

转载自blog.csdn.net/qq_32424059/article/details/88077723