Minimum Deci | Function to find the count of minimum Deci - Binary numbers required to obtain S ; Stores the minimum count ; Iterate over the string s ; Convert the char to its equivalent integer ; If current character is the maximum so far ; Update the maximum digit ; Print the required result ; Driver code
function minimum_deci_binary_number ( s ) { let m = Number . MIN_VALUE ; for ( let i = 0 ; i < s . length ; i ++ ) { let temp = s [ i ] - ' ' ; if ( temp > m ) { m = temp ; } } return m ; } let S = " " ; document . write ( minimum_deci_binary_number ( S ) ) ;