[C++]Easy to Understand || Simple C++ Code || Better than 90% Memory Utilization
Upvote if you like it!!!\n\nvector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter){\n    vector<vector<int>> result(rows*cols,vecto
Upvote if you like it!!!\n```\nvector<vector<int>> allCellsDistOrder(int rows, int cols, int rCenter, int cCenter){\n    vector<vector<int>> result(rows*cols,vector<int>(3));\n    int counter=0;\n    for(int row=0;row<rows;row++)\n    {\n        for(int column=0;column<cols;column++)\n        {\n            result.at(counter++)={row,column,(abs(row-rCenter)+abs(column-cCenter))};\n        }\n    }\n    sort(result.begin(),result.end(),[](vector<int>& c1,vector<int>& c2)\n         {\n             return c1[2]<c2[2];\n         });\n    for(vector<int>&element: result)\n    {\n        element.pop_back();\n    }\n    return result;\n}\n```
['C']