Monday, November 12, 2012


Given a number n and another number m, which is a permutation of n find the number of moves needed to transform m into n.

1 comment:

  1. This looks to me like a Breadth First Search problem...

    It is really similar to a problem on Top Coder I tried to solve a few weeks ago:
    In that case, the sequence was with letters, not numbers, but the solution should be really similar.