Exercise 1: Sum of Integers
Given an array of integers, an integer representing the sum of all numbers in the array. If the array is empty, return 0.
Input: []
Output: 0
Input: [1,3,4]
Output: 8
Input: [-1, 2, 0, 1, -2]
Output: 0
Sketch:
Script:
Given an array of integers, an integer representing the sum of all numbers in the array. If the array is empty, return 0.
Input: []
Output: 0
Input: [1,3,4]
Output: 8
Input: [-1, 2, 0, 1, -2]
Output: 0
Sketch:
Script: