Kind of tailored to the orders of magnitude approach of the test suite; complexity would have to increase significantly if you split the intervals say [10000 50000] instead of [1e4 1e5-1].
Everything is perfect in this code.
this is not really a general solution, perhaps you could add more complicated cases in the testsuite? for example pandigital_nb(2200,4000)==10, pandigital_nb(250,40000)==98, pandigital_nb(35327,43854637)==23030
I hesitated to add tests that I can't solve by myself.
I see, check solution 443089, that should be a general and relatively fast solution
Project Euler: Problem 3, Largest prime factor
412 Solvers
Find the sum of the elements in the "second" diagonal
1006 Solvers
Calculate the Hamming distance between two strings
180 Solvers
Determine if input is a perfect number
148 Solvers
Add a row of zeros on top of a matrix
199 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!