Add Two Integers

Given two integers num1 and num2, return the sum of the two integers.

30:00

Add Two Integers
easy
Free written solution
Topics
Companies

Given two integers num1 and num2, return the sum of the two integers.

Example 1:
Input: {"num1":12,"num2":5}
Output: 17
Constraints:
  • −100≤num1,num2≤100-100 \leq \text{num1}, \text{num2} \leq 100

Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result

Run code to see results.

Input
arr ={"num1":12,"num2":5}

Read num1 = 12 and num2 = 5. Adding means starting at num1 and moving num2 steps along the number line.

12

num1

+

5

num2

=

?

sum

Number line

jump of 10

step of 1

-505101520
moved: +0
tens left: 0
ones left: 5
Variables
VariableValue
num112
num25
DepthFunction Call
Stack empty
0/7