SHARE
TWEET

Untitled

a guest Sep 21st, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let arr = [];
  2.  
  3. for (let i = 100; i < 1000; i++) {
  4.   for (let j = 100; j < 1000; j++) {
  5.     let answer = i * j;
  6.     let aStr = answer.toString().split('');
  7.     if (aStr[0] === aStr[aStr.length - 1]) {
  8.       if (aStr[1] === aStr[aStr.length - 2]) {
  9.         if (aStr[2] === aStr[aStr.length - 3]) {
  10.           arr.push(answer);
  11.         }
  12.       }
  13.     }
  14.   }
  15. }
  16.  
  17. console.log(Math.max(...arr));
RAW Paste Data
Top