Files
cpp-flashcards/org/study_deck_02/dsa/bit-manipulation/0371-sum-of-two-integers.org
T

47 lines
786 B
Org Mode
Raw Normal View History

2026-06-01 18:12:40 +08:00
#+ANKI_DECK: study_deck_02
* TODO 0371. Sum of Two Integers :medium:
:PROPERTIES:
:NEETCODE: [[file:../../roadmap.org::*0371. Sum of Two Integers][0371. Sum of Two Integers]]
:END:
Given two integers ~a~ and ~b~, return /the sum of the two integers without using the operators/ ~+~ /and/ ~-~.
*Example 1:*
#+begin_src
Input: a = 1, b = 2
Output: 3
#+end_src
*Example 2:*
#+begin_src
Input: a = 2, b = 3
Output: 5
#+end_src
*Constraints:*
- ~-1000 <= a, b <= 1000~
** TODO Approach
Write your approach here.
** TODO Python
2026-06-05 22:32:49 +08:00
#+begin_src python :lc-problem 371 :lc-lang python3
class Solution:
def getSum(self, a: int, b: int) -> int:
#+end_src
** TODO C++
2026-06-05 22:32:49 +08:00
#+begin_src cpp :lc-problem 371
class Solution {
public:
int getSum(int a, int b) {
}
};
#+end_src