Function to minimize String
function minimize ( str ) { let mstr = " " ; let l , i , flagchar = new Array ( 26 ) ; for ( let i = 0 ; i < 26 ; i ++ ) { flagchar [ i ] = 0 ; } let ch ; l = str . length ;