Skip to content

Instantly share code, notes, and snippets.

@matinkaboli
Created September 21, 2017 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matinkaboli/c0366beb177a4b1f1ee452694750ac98 to your computer and use it in GitHub Desktop.
Save matinkaboli/c0366beb177a4b1f1ee452694750ac98 to your computer and use it in GitHub Desktop.
let arr = [];
for (let i = 100; i < 1000; i++) {
for (let j = 100; j < 1000; j++) {
let answer = i * j;
let aStr = answer.toString().split('');
if (aStr[0] === aStr[aStr.length - 1]) {
if (aStr[1] === aStr[aStr.length - 2]) {
if (aStr[2] === aStr[aStr.length - 3]) {
arr.push(answer);
}
}
}
}
}
console.log(Math.max(...arr));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment