i agree that excluding the test data generation from the test should have been required. additionally, the original task should have been formulated much more general, i.e:
Given a function that takes a list of n random integers between x and y,
find the difference between the smallest and the largest numbers whose digits sum up to m.
then define the parameter values for testing and performance evaluation. that should have prevented at least some of the proposed compile time optimizations.
edit: i'm aware though that the performance characteristics might be very different depending on the value of "n", especially when it comes to multithreading, so there should be a clause for that (e.g. n usually > 1m).
edit: i'm aware though that the performance characteristics might be very different depending on the value of "n", especially when it comes to multithreading, so there should be a clause for that (e.g. n usually > 1m).