sortLetterStr = (letterStr) => {
let arr = new Array();
for (let i = 0; i < letterStr.length; ++i) {
arr.push(letterStr[i].charCodeAt());
}
arr.sort((x, y) => (x - y));
let res = "";
for (let i = 0; i < arr.length; ++i) {
let x = arr[i];
let A = 'A'.charCodeAt();
let Z = 'Z'.charCodeAt();
let a = 'a'.charCodeAt();
let val = 0;
if (x >= A && x <= Z) {
val = x - A;
} else {
val = x - a;
}
val = (val + 1) * (val + 1) % 26;
if (x >= A && x <= Z) {
res += String.fromCharCode(val + A);
} else {
res += String.fromCharCode(val + a);
}
}
return res;
};