Driver code
let arr = [ 1 , 2 , 3 , 4 , 5 ] ; let n = arr . length ; calculatePrefixSum ( arr , n ) ; document . write ( findMean ( 1 , 2 ) + " " ) ; document . write ( findMean ( 1 , 3 ) + " " ) ; document . write ( findMean ( 1 , 4 ) + " " ) ;