Counts 1 s that can be obtained in an Array by performing given operations | Function to count total number of 1 s in array by performing the given operations ; Stores count of 1 s in the array by performing the operations ; Update cntOnes ; Driver code
function cntOnesArrWithGivenOp ( arr , N ) { var cntOnes = 0 ; cntOnes = parseInt ( Math . sqrt ( N ) ) ; return cntOnes ; } var arr = [ 0 , 0 , 0 , 0 , 0 ] ; var N = arr . length ; document . write ( cntOnesArrWithGivenOp ( arr , N ) ) ;