• + 0 comments

    Java int array [ ] = new int[n]; for(List operation: operations){ int a = operation.get[0]-1; int b = operation.get[1]-1; int k = operation.get[2]; for(int i=a; i<=b; i++){ array[i]+= k; } }

                    int sum =0;
                                        for(int i=0 i<n; i++){
                    sum+= array[i];
    }
    return Math.round(sum/n);
    
    
    
    
    
    }