Check if after adding the frequency , the character is less than ' z ' or not
if ( s [ i ] . charCodeAt ( 0 ) + add <= " " . charCodeAt ( 0 ) ) s [ i ] = String . fromCharCode ( s [ i ] . charCodeAt ( 0 ) + add ) ;