Created
September 21, 2017 21:43
-
-
Save matinkaboli/c0366beb177a4b1f1ee452694750ac98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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