C++ | Using vector of pair | Simple approach
\nclass Solution {\npublic:\n\n    vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) {\n        vector<pair<int,vector<int>>> 
```\nclass Solution {\npublic:\n\n    vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) {\n        vector<pair<int,vector<int>>> pr; \n        for(int i=0; i<rows; i++){\n            for(int j=0; j< cols; j++){\n                int d = abs(rCenter-i) + abs(cCenter - j);\n                vector<int>temp;\n                temp.push_back(i);\n                temp.push_back(j);\n                pr.push_back(make_pair(d,temp));\n            }\n        }\n        \n        sort(pr.begin(), pr.end());\n        vector<vector<int>> ans;\n        \n        for(int i=0; i<pr.size(); i++){\n            ans.push_back(pr[i].second);\n        }\n        return ans;\n        \n    }\n};\n```
['C', 'C++']