Strobogrammatic Number
Description
null
Solution(javascript)
/**
* @param {string} num
* @return {boolean}
*/
var isStrobogrammatic = function(num) {
const map = {
6: "9",
9: "6",
1: "1",
0: "0",
8: "8"
}
for(let i = 0; i < num.length/2; i++) {
if(num[i] !== map[num[num.length-1 -i]]) {
return false
}
}
return true
};