xxxxxxxxxx
function rotateNumber(num, rotation) {
const strNum = String(num);
const length = strNum.length;
rotation = rotation % length;
const rotated = strNum.slice(rotation) + strNum.slice(0, rotation);
return rotated;
}
function derotateNumber(rotatedNum, rotation) {
const strNum = String(rotatedNum);
const length = strNum.length;
rotation = rotation % length;
const derotated = strNum.slice(length - rotation) + strNum.slice(0, length - rotation);
return derotated;
}