Minimum number of cuts required to pay salary from N length Gold Bar | Function to find the minimum number of cuts to pay the worker . ; Nearest Integer to the Log value of the number N ; Driver code ; Cuts Required in the Length of 15
function pay ( n ) { let cuts = parseInt ( Math . log ( n ) / Math . log ( 2 ) ) ; return cuts ; } let n = 5 ; let cuts = pay ( n ) ; document . write ( cuts + " " ) ; n = 15 ; cuts = pay ( n ) ; document . write ( cuts + " " ) ;