if i - th alphabet not in first k letters then make it as " a " and then increase ( i - 1 ) th letter
if ( s [ i ] . charCodeAt ( 0 ) >= m ) { s [ i ] = ' ' ; s [ i - 1 ] = String . fromCharCode ( s [ i - 1 ] . charCodeAt ( 0 ) + 1 ) ; i -- ; }