Skip to content

Practice Sum of Two Integers

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#371
LeetCode Problem

Sum of Two Integers

Problem Statement

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

Source: Sum of Two Integers on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
a = 1, b = 2
Output
3

# Example 2

Input
a = 2, b = 3
Output
5

Constraints

-1000 <= a, b <= 1000

Related LeetCode Problems

Practice more problems similar to Sum of Two Integers.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.