1
0
www.mikescher.com/www/statics/euler/euler_032_explanation.md
2017-11-08 17:39:51 +01:00

373 B

The main focus here was optimizing the pandigital testing. The rest is just looping over every possible number.
We can optimize the outer loop a little bit if we look at the possible multiplicands. There are only 2 possibilities if we need 9 digits in our calculation:

  • 1-digit number * 4-digit number = 4-digit number
  • 2-digit number * 3-digit number = 4-digit number