인생일지

반응형

 

 

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

반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band
loading