1
# Runtime: 93 ms (Top 39.62%) | Memory: 14.1 MB (Top 16.60%)5
def slidingPuzzle(self, board: List[List[int]]) -> int:7
directs = [[0, 1], [0, -1], [1, 0], [-1, 0]]12
for dr, dc in directs:13
tmp = [row.copy() for row in board]15
if r in range(2) and c in range(3):16
tmp[r][c], tmp[i][j] = tmp[i][j], tmp[r][c]21
target = [[1, 2, 3], [4, 5, 0]]24
rows, cols = len(board), len(board[0])25
q = collections.deque()28
for row in range(rows):29
for col in range(cols):30
if board[row][col] == 0:31
boards = findNei(board)35
visited.add(tuple([tuple(row) for row in b]))41
for _ in range(len(q)):47
t = tuple([tuple(row) for row in b])