by two-star · 2y ago · 0 comments
Only positive integers are meant to be allowed. (Zero excluded.)
Combining is meant to work on adjacent pairs of integers.
If this is used in coding interviews, I deny any responsibility. Unless it's used in interviewing me, in which case I will totally take credit.
And for n=7 it's [5,4,1,2,7] with a minimum of 26 moves.