676. Recursive Array Sum
0
Easy
Given an array nums of N integers, create a recursive function to calculate the sum of its elements.
Input Format
The first line of input should contain the size of the array, N. The second line should contain the elements of the array separated by spaces.
Output Format
Print the sum of the elements in the array.
Example
Input
5
7 3 6 -1 9
Output
24
Constraints
1<= N <= 10000000
-1000<= nums[i] <= 1000
-1000<= nums[i] <= 1000
Loading...
View Submissions
Console