This answer is a fairly extreme example. For the largest input it would create an array with 1.048576e+26 elements which is not going to fit in RAM anytime soon (maybe not even physically possible).
However given enough time and memory it would reach the answer eventually
In the case the the practical answers are not able to be made shorter, how should a winner be chosen?
There are already questions on meta about explicit extra conditions, but I am asking about implicit limitations here.