Python | BFS | O(mn)
```\nfrom collections import deque\nclass Solution:\n    def allCellsDistOrder(self, rows: int, cols: int, rCenter: int, cCenter: int) -> List[List[int]]:\n    
```\nfrom collections import deque\nclass Solution:\n    def allCellsDistOrder(self, rows: int, cols: int, rCenter: int, cCenter: int) -> List[List[int]]:\n        que = deque([(rCenter,cCenter)])\n        visited = set()\n        res = []\n        while que:\n            r,c = que.popleft()\n            if (r,c) in visited: continue\n            visited.add((r,c))\n            res.append([r,c])\n            for dr, dc in [[-1,0],[1,0],[0,-1],[0,1]]:\n                if 0<=r+dr<rows and 0<=c+dc<cols:\n                    que.append((r+dr,c+dc))\n        return res
['Python']