text: Minimize number of cuts required to break N length stick into N unit length sticks | Function to return the minimum time required to split stick of N into length into unit pieces ; Return the minimum unit of time required ; Driver code
code: function min_time_to_cut ( N ) { if ( N == 0 ) return 0 ; return Math . ceil ( Math . log ( N ) / Math . log ( 2 ) ) ; } let N = 100 ; document . write ( min_time_to_cut ( N ) ) ;