Simple Solution || Using Multimap || Without comparator
Code\n\nclass Solution {\npublic:\n    vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) {\n        int i, j, dis = 0;\n      
# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter) {\n        int i, j, dis = 0;\n        multimap<int, vector<int>> mp;\n        for (i = 0; i < rows; i++) \n        {\n            for (j = 0; j < cols; j++) \n            {\n                vector<int> temp;\n                dis = abs(i - rCenter) + abs(j - cCenter);\n                temp.push_back(i);\n                temp.push_back(j);\n                mp.insert(pair<int, vector<int>>(dis, temp));\n            }\n        }\n\n        // converting multimap into a 2d vector\n        vector<vector<int>> ans;\n        for (auto x: mp)\n        {\n            ans.push_back(x.second);\n        }\n        return ans;\n    }\n};\n```
['C++']