NumPuzz II

We consider again the iPhone game NumPuzz. Please refer to previous problem: NumPuzz I for details of the game. This task may be thought of as the opposite of previous problem. Write a program that accepts as input an initial configuation of a game instance, and returns a solution that takes the fewest clicks possible. Input The input format here corresponds exactly to the output format of pre- vious problem. The first line of each case gives the case number, and the following three lines contains the matrix entries at the start of the game. Output For each test case, output a string that describes an optimal solution to the given puzzle. Use ‘a’ to represent the upper left corner, ‘b’ for the square to its right, etc. Print an empty line if no clicks are required. If the puzzle is unsolvable, output ‘No solution.’ instead. Sample Input Case #1: 111 111 100 Case #2: 000 000 000 Case #3: 333 343 333 Sample Output cd cdifbgah