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

47 lines
736 B
Org Mode
Raw Normal View History

#+PROPERTY: 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
#+begin_src python
class Solution:
def getSum(self, a: int, b: int) -> int:
#+end_src
** TODO C++
#+begin_src cpp
class Solution {
public:
int getSum(int a, int b) {
}
};
#+end_src