N Puzzle Solver