Write a function array_product(arr) that returns the product of all elements in an array without using np.prod() or math.prod().
Example:
Input: arr = [1, 2, 3, 4, 5]
Output: 120
Constraints:
Test Cases
Test Case 1
Input:
[1, 2, 3, 4, 5]Expected:
120Test Case 2
Input:
[2, 3, 7]Expected:
42Test Case 3
Input:
[5, 0, 3]Expected:
0+ 2 hidden test cases