Sum of Two Numbers
easySave
ArrayMath
Given two numbers, calculate the sum of the two numbers.
Example 1
Input
[ 5, 3 ]
Output
8
Explanation. The sum of 5 and 3 is 8.
Example 2
Input
[ -1, 1 ]
Output
0
Explanation. The sum of -1 and 1 is 0.
Example 3
Input
[ 100, 200 ]
Output
300
Explanation. The sum of 100 and 200 is 300.
Example 4
Input
[ 0, 0 ]
Output
0
Explanation. The sum of 0 and 0 is 0.
Follow-up: Can you modify the solution to handle any number of inputs?
Constraints:
The input will consist of two integers. Both the numbers can be negative or positive.
- Views
- 6