You are viewing a single comment's thread. Return to all comments →
I guess this is linked to your pandigital generation.
I use string permutations to create all pandigital numbers.
Create all string permutations of "12" "123" "1234" ...
Then just check primality for each of those generated numbers.
Each case takes me 2.5 seconds except one (TC 4 I think) which is cleared in 5s
I also always use memoization on each problem because there will always be one case causing trouble.