Minimum steps required to reduce all the elements of the array to zero | Function to return the minimum steps required to reduce all the elements to 0 ; Maximum element from the array ; Driver code
function minSteps ( arr , n ) { let maxVal = Math . max ( ... arr ) ; return maxVal ; } let arr = [ 1 , 2 , 4 ] ; let n = arr . length ; document . write ( minSteps ( arr , n ) ) ;