I’m trying to solve Problem 41of project Euler in Java, by counting the number from 99888888 to 80000000(which took very long time 🙁 ), I got 98765431 as an answer, but I’m getting that answer not correct. Could anyone please tell me the reason of not getting the correct answer and how can I speed my program?
Share
A pandigital number doesn’t needs to contain all numbers from
1 to 9, but all from1 to length.So, you’ll need to try all permutations from
1 to 9starting with 1 digit and going up, filtering all prime numbers and, then, taking largest one.