Decrypt String from Alphabet to Integer Mapping

EasyString

Solution

export function freqAlphabets(s: string): string {
  const decrypt = (chars: string) => {
    const code = parseInt(chars.replace('#', '')) + 96;
    return String.fromCharCode(code);
  };
 
  return s.replace(/(\d\d#|\d)/g, decrypt);
}