class Solution {
public double solution(int[] arr) {
int aLength = arr.length;
double sum = 0;
if(arr != null && aLength != 0){
for(int i = 0; i < aLength; i++) {
sum += arr[i];
}
} else return sum;
return sum / aLength;
}
}
출저:
https://programmers.co.kr/learn/courses/30/lessons/12944