function hasZeroInCenter(num: number) {
// Convert the number to a string
const numStr: string = num.toString();
if (numStr.length % 2 === 0) {
return false; // Even length = no center digit
}
const centerIndex: number = Math.floor(numStr.length / 2);
return numStr.charAt(centerIndex) === '0';
}
const num: number = 3720961;
if (hasZeroInCenter(num)) {
console.log("yes");
} else {
console.log("no");
}
/*
run:
"yes"
*/