Python3 simple solution using dictionary
\nclass Solution:\n    def allCellsDistOrder(self, R: int, C: int, r0: int, c0: int) -> List[List[int]]:\n        d = {}\n        for i in range(R):\n          
```\nclass Solution:\n    def allCellsDistOrder(self, R: int, C: int, r0: int, c0: int) -> List[List[int]]:\n        d = {}\n        for i in range(R):\n            for j in range(C):\n                d[(i,j)] = d.get((i,j),0) + abs(r0-i) + abs(c0-j)\n        return [list(i) for i,j in sorted(d.items(), key = lambda x : x[1])]\n```\n**If you like this solution, please upvote for this**
['Python3']