//sample solution
function reverseBits(a) {
return a.split("").reverse().join("");
}
function changeToBinary(a){
return (a >>> 0).toString(2);
}
function changeToDecimal(a){
return parseInt(a,2);
}
function mirrorBits(a) {
return changeToDecimal(reverseBits(changeToBinary(a)));
}
No comments:
Post a Comment