Thank you. I can not resolve it in quicker time, right?
Also:
dlang online compiler and dpaste:
return code: 9 killed
why?
thank you
On Saturday, 7 June 2014 at 21:57:31 UTC, Chris Cain wrote:
On Saturday, 7 June 2014 at 21:40:08 UTC, Agora wrote:
Why is running slow?
One of the main reasons is because the number of permutations
an array has is n!. Thus the expected runtime is O(n!). That's
a slow, slow algorithm in general. In particular, your array
with length 11 has 39,916,800 permutations (although it,
obviously, doesn't have to go through *all* of those to get the
sorted sequence in this case).