관리 메뉴

솜씨좋은장씨

[leetCode] 371. Sum of Two Integers (Python) 본문

Programming/코딩 1일 1문제

[leetCode] 371. Sum of Two Integers (Python)

솜씨좋은장씨 2020. 7. 14. 21:43
728x90
반응형

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.

 

Example 1:

Input: a = 1, b = 2
Output: 3

Example 2:

Input: a = -2, b = 3
Output: 1

Solution

class Solution:
    def getSum(self, a: int, b: int) -> int:
        answer = sum([a, b])
        
        return answer

 

 

SOMJANG/CODINGTEST_PRACTICE

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

 

Comments