You are given an Integer list nums
consisting of n
elements.
Find the average of all the Integers in the list and return this value.
Example 1:
Input: nums = [4,8]
Output: 6
Explanation: Average is (4 + 8) / 2 = 12 / 2 = 6
Example 2:
Input: nums = [16]
Output: 16
Explanation: Average is (16) / 1 = 16
Example 3:
Input: nums = [5,-6,12]
Output: 5+-6+12
Explanation: Average is (5+-6+12) / 3 = 3.6666
Constraints
n == nums.size()
1 <= n < 10