xxxxxxxxxx
23
function palindrome(n) {
let s = n.toString();
let p = true;
for (let i = 0; i < s.length; i++) {
if (s[i] != s[s.length - 1 - i]) {
p = false;
}
}
return p;
}
let highest = 0;
for (let x = 999; x >= 900; x--) {
for (let y = 999; y >= 900; y--) {
let p = x * y;
if (palindrome(p) && p > highest) {
highest = p;
}
}
}
console.log(highest);