[Python 3] 0-1 BFS clean code
\tclass Solution:\n\t\tdef minPushBox(self, grid: List[List[str]]) -> int:\n\t\t\tn,m=len(grid),len(grid[0])\n\t\t\tfor i in range(n):\n\t\t\t\tfor j in range(m
\tclass Solution:\n\t\tdef minPushBox(self, grid: List[List[str]]) -> int:\n\t\t\tn,m=len(grid),len(grid[0])\n\t\t\tfor i in range(n):\n\t\t\t\tfor j in range(m):\n\t\t\t\t\tif grid[i][j]==\'S\':\n\t\t\t\t\t\tplayer=[i,j]\n\t\t\t\t\telif grid[i][j]==\'T\':\n\t\t\t\t\t\ttarget=[i,j]\n\t\t\t\t\telif grid[i][j]==\'B\':\n\t\t\t\t\t\tbox=[i,j]\n\t\t\tq=deque([[player[0],player[1],box[0],box[1],0]])\n\t\t\tvis=set([(player[0],player[1],box[0],box[1])])\n\t\t\twhile q:\n\t\t\t\ti,j,bi,bj,steps=q.pop()\n\t\t\t\tif [bi,bj]==target:\n\t\t\t\t\treturn steps\n\t\t\t\tfor dx,dy in [(0,1),(1,0),(-1,0),(0,-1)]:\n\t\t\t\t\tx,y=i+dx,j+dy\n\t\t\t\t\tif 0<=x<n and 0<=y<m and grid[x][y]!=\'#\':\n\t\t\t\t\t\tif (x,y)==(bi,bj):\n\t\t\t\t\t\t\tif 0<=bi+dx<n and 0<=bj+dy<m and grid[bi+dx][bj+dy]!=\'#\':\n\t\t\t\t\t\t\t\tif not (x,y,bi+dx,bj+dy) in vis:\n\t\t\t\t\t\t\t\t\tvis.add((x,y,bi+dx,bj+dy))\n\t\t\t\t\t\t\t\t\tq.appendleft([x,y,bi+dx,bj+dy,steps+1])\n\t\t\t\t\t\telif (x,y,bi,bj) not in vis:\n\t\t\t\t\t\t\tvis.add((x,y,bi,bj))\n\t\t\t\t\t\t\tq.append([x,y,bi,bj,steps])\n\t\t\treturn -1
['Breadth-First Search', 'Python3']