python3, 32ms, 100%, tarjan+A*
python []\nclass Solution:\n    def minPushBox(self, grid: List[List[str]]) -> int:\n        m, n, g = len(grid), len(grid[0]), collections.defaultdict(list)\n 
```python []\nclass Solution:\n    def minPushBox(self, grid: List[List[str]]) -> int:\n        m, n, g = len(grid), len(grid[0]), collections.defaultdict(list)\n        for i in range(m):\n            for j in range(n):\n                g[grid[i][j]] += [complex(i, j)]\n        def f(b, s): \n            nonlocal time\n            time += 1\n\t\t\tboxToTarget = b - target\n            return (abs((boxToTarget).real) + abs((boxToTarget).imag) + s, abs(boxToTarget), time)\n        player, box, target, time = *g[\'S\'], *g[\'B\'], *g[\'T\'], 1\n        floor = {player, target, box, *g[\'.\']}\n        alphaStarQueue = [(f(box, 1), 1, player, box)]\n        directions, visited = (1, 1j, -1, -1j), set()\n        low = dict.fromkeys(floor, 0)\n        dfn = low.copy()\n        count = 0\n        index = {}\n        def tarjan(currIndex, parentIndex):\n            nonlocal count\n            count += 1\n            dfn[currIndex] = low[currIndex] = count\n            index[count] = currIndex\n            for direction in directions:\n                nextIndex = currIndex + direction\n                if nextIndex in floor and nextIndex != parentIndex:\n                    if not low[nextIndex]:\n                        tarjan(nextIndex, currIndex)\n                    low[currIndex] = min(low[currIndex], low[nextIndex])\n        tarjan(box, -1)\n        for currIndex in floor:\n            connect = [currIndex]\n            while dfn[connect[-1]] != low[connect[-1]]:\n                connect.append(index[low[connect[-1]]])\n            for w in connect[: -2]:\n                low[w] = low[connect[-1]]\n        while alphaStarQueue:\n            _, steps, currPlayer, currBox = heapq.heappop(alphaStarQueue)\n            for direction in directions:\n                nextPlayer, nextBox = currBox - direction, currBox + direction\n                if nextBox in floor \\\n                    and nextPlayer in floor \\\n                        and (nextPlayer, currBox) not in visited \\\n                            and low[currPlayer] == low[nextPlayer]:\n                    if nextBox == target:\n                        return steps\n                    heapq.heappush( alphaStarQueue, (f(nextBox, steps + 1), steps + 1, currBox, nextBox))\n                    visited.add((nextPlayer, currBox))\n        return -1\n```
[]