note
robin
It also fails for <c>$n == 3</c>, where the answers should be 231 and 312, each of which take 2 steps.
<p>
So just do <c>|| @$copy <= 3</c>, one might say; and indeed that would give the right answers. But how do we know it would give the right answers, except by comparing the output with the unoptimized version? Is it possible to prove that this is safe?
513179
513393