Maximize count of equal numbers in Array of numbers upto N by replacing pairs with their sum | Function to count maximum number of array elements equal ; Driver Code ; Function Call
function countEqual ( n ) { return parseInt ( ( n + 1 ) / 2 ) ; } var arr = [ 1 , 2 , 3 , 4 , 5 , 6 ] ; var n = arr . length ; document . write ( countEqual ( n ) ) ;