The string up to the point specified in the question , the string remains unchanged and from the point up to the length of the string , we reverse the alphabetical order
let answer = " " ; for ( let i = 0 ; i < n ; i ++ ) answer = answer + str [ i ] ; for ( let i = n ; i < l ; i ++ ) answer = answer + reverseAlphabet [ str [ i ] . charCodeAt ( ) - ' ' . charCodeAt ( ) ] ; return answer ; }