C++ solution using Hashtable without lambda function
\tclass Solution {\n\tpublic:\n\t\tvector> allCellsDistOrder(int R, int C, int r0, int c0) {\n\t\t\tvector> res;\n\t\t\tfor(int i=0;i<R;i++)\n\t\t\t\tfor(int j=
\tclass Solution {\n\tpublic:\n\t\tvector<vector<int>> allCellsDistOrder(int R, int C, int r0, int c0) {\n\t\t\tvector<vector<int>> res;\n\t\t\tfor(int i=0;i<R;i++)\n\t\t\t\tfor(int j=0;j<C;j++){\n\t\t\t\t\tres.push_back({i,j});\n\t\t\t\t}\n\t\t\tset<int> cnt;\n\t\t\tunordered_map<int,vector<vector<int>>> m;\n\t\t\tfor(auto x:res){\n\t\t\t\tint dis=abs(x[0]-r0)+abs(x[1]-c0);\n\t\t\t\tcnt.insert(dis);\n\t\t\t\tm[dis].push_back(x);\n\t\t\t}\n\t\t\tvector<int> cur{cnt.begin(),cnt.end()};//convert set into vector\n\t\t\tsort(cur.begin(),cur.end());\n\t\t\tvector<vector<int>> ans;\n\t\t\tfor(int i=0;i<cur.size();i++){\n\t\t\t\tfor(auto x:m[cur[i]]){\n\t\t\t\t\tans.push_back(x);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ans;\n\t\t}\n\t};
['Hash Table', 'C', 'C++']