Brute Force 👀 🎊 | | C++ 
Complexity

Time complexity:
O(Rows∗Cols∗Log(Rows∗Cols))


Space complexity:
O(Rows∗Cols)

Code
# Complexity
- Time complexity:
$$O(Rows∗Cols∗Log(Rows∗Cols))$$

- Space complexity:
 $$O(Rows*Cols)$$ 

# Code
```cpp []
class Solution {
public:
    vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter,
                                          int cCenter) {
        vector<int> storeDistance;
        vector<vector<int>> storeCordinates, answer;
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                int r1 = i;
                int c1 = j;

                storeDistance.push_back(abs(r1 - rCenter) + abs(c1 - cCenter));
                storeCordinates.push_back({i, j});
            }
        }

        sort(storeDistance.begin(), storeDistance.end());

        for (int i = 0; i < storeDistance.size(); i++) {
            for (int j = 0; j < storeCordinates.size(); j++) {
                int r1 = storeCordinates[j][0];
                int c1 = storeCordinates[j][1];

                int dis = abs(r1 - rCenter) + abs(c1 - cCenter);

                if (dis == storeDistance[i]) {
                    answer.push_back({r1, c1});
                    storeCordinates[j][0] = -1000;
                    storeCordinates[j][1] = -1000;
                    break;
                }
            }
        }
        return answer;
    }
};
```
['Array', 'Sorting', 'Matrix', 'C++']