Monday, November 12, 2012

Transormations

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: https://github.com/davideanastasia/coding-exercises/blob/master/SmartWorldToy/SmartWorldToy.cpp
    In that case, the sequence was with letters, not numbers, but the solution should be really similar.

    ReplyDelete