C++ BFS - DFS solution [32ms]
\nvector<int> dx={1,0,-1,0};\nvector<int> dy={0,1,0,-1};\nint memo[20][20];\nbool dfs(int i1,int j1,int i2,int j2,int b1,int b2,vector<vector<char>>& grid)\n{\n
```\nvector<int> dx={1,0,-1,0};\nvector<int> dy={0,1,0,-1};\nint memo[20][20];\nbool dfs(int i1,int j1,int i2,int j2,int b1,int b2,vector<vector<char>>& grid)\n{\n    memset(memo,0,sizeof(memo));  \n    return hasPath(i1,j1,i2,j2,b1,b2,grid);\n}\nbool hasPath(int i1,int j1,int i2,int j2,int b1,int b2,vector<vector<char>>& grid)\n{\n    if(grid[i1][j1]==\'#\'||(i1==b1&&j1==b2))\n        return false;\n    memo[i1][j1]=1;\n    if(i1==i2&&j1==j2)\n        return true;\n    else\n    {\n        bool q=false;\n        for(int k=0;k<4;++k)\n            if(i1+dx[k]<0||j1+dy[k]<0||i1+dx[k]>=grid.size()||j1+dy[k]>=grid[0].size()||memo[i1+dx[k]][j1+dy[k]])\n                continue;\n            else\n                q=q||hasPath(i1+dx[k],j1+dy[k],i2,j2,b1,b2,grid);\n        return q;\n    }\n            \n}\nint minPushBox(vector<vector<char>>& grid) \n{\n    int grey[20][20][20][20];\n    memset(grey,0,sizeof(grey));\n    queue<vector<int>> q;\n    int n=grid.size(),m=grid[0].size();\n    int i1,j1,i2,j2,e1,e2;\n    for(int i=0;i<n;++i)\n        for(int j=0;j<m;++j)\n            if(grid[i][j]!=\'#\')\n            {\n                if(grid[i][j]==\'S\')\n                {\n                    i2=i;\n                    j2=j;\n                }\n                else if(grid[i][j]==\'B\')\n                {\n                    i1=i;\n                    j1=j;\n                }\n                else if(grid[i][j]==\'T\')\n                {\n                    e1=i;\n                    e2=j;\n                }\n            }\n    q.push({i1,j1,i2,j2,0});\n    grey[i1][j1][i2][j2]=1;\n    while(!q.empty())\n    {\n        vector<int> temp=q.front();\n        q.pop();\n        i1=temp[0],j1=temp[1],i2=temp[2],j2=temp[3];\n        int d=temp[4];\n        if(i1==e1&&j1==e2)\n            return d;\n        else\n        {\n            if(i1+1<n&&grid[i1+1][j1]!=\'#\'&&i1>0&&grid[i1-1][j1]!=\'#\'&&dfs(i2,j2,i1-1,j1,i1,j1,grid)&&!grey[i1+1][j1][i1][j1])\n            {\n                q.push({i1+1,j1,i1,j1,d+1});\n                grey[i1+1][j1][i1][j1]=1;\n            }\n            if(j1+1<m&&grid[i1][j1+1]!=\'#\'&&j1>0&&grid[i1][j1-1]!=\'#\'&&dfs(i2,j2,i1,j1-1,i1,j1,grid)&&!grey[i1][j1+1][i1][j1])\n            {\n                q.push({i1,j1+1,i1,j1,d+1});\n                grey[i1][j1+1][i1][j1]=1;\n            }\n            if(i1>0&&grid[i1-1][j1]!=\'#\'&&i1+1<n&&grid[i1+1][j1]!=\'#\'&&dfs(i2,j2,i1+1,j1,i1,j1,grid)&&!grey[i1-1][j1][i1][j1])\n            {\n                q.push({i1-1,j1,i1,j1,d+1});\n                grey[i1-1][j1][i1][j1]=1;\n            }\n            if(j1>0&&grid[i1][j1-1]!=\'#\'&&j1+1<m&&grid[i1][j1+1]!=\'#\'&&dfs(i2,j2,i1,j1+1,i1,j1,grid)&&!grey[i1][j1-1][i1][j1])\n            {\n                q.push({i1,j1-1,i1,j1,d+1});\n                grey[i1][j1-1][i1][j1]=1;\n            }\n        }\n            \n    }\n    return -1;\n}\n```
['Depth-First Search', 'Breadth-First Search', 'C']