Given an array of integers nums, return the sum of all elements using recursion.
You must solve this problem recursively — do not use any loops (for, while, etc.).
For example, if the input is [1, 2, 3, 4, 5], the output should be 15.
nums = [1, 2, 3, 4, 5]15nums = []0nums = [-1, 1]00 <= nums.length <= 10^4-10^4 <= nums[i] <= 10^4You must use recursion (no loops).Run your code to see results
Use Cmd+Enter to run