class Solution { public double solution(int[] arr) { double answer = 0; double average = 0; int sum = 0; for(int i=0; i< arr.length; i++){ sum += arr[i]; } average = (double) sum/ arr.length; answer = average; return answer; } }
O(n)