C++ || MAP
\n\nclass Solution {\npublic:\n    static bool comp(string &a,string &b){\n        return stoi(a)<stoi(b);\n    }\n    vector<vector<string>> displayTable(vecto
```\n\nclass Solution {\npublic:\n    static bool comp(string &a,string &b){\n        return stoi(a)<stoi(b);\n    }\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        vector<vector<string>>res;\n        vector<string>food;\n        vector<string>table;\n        map<string,int>f,t;\n        map<pair<string,string>,int>m;\n        for(auto i:orders){\n            if(!f.count(i[2])){\n                f[i[2]]=1;\n                food.push_back(i[2]);\n            }\n            if(!t.count(i[1])){\n                t[i[1]]=1;\n                table.push_back(i[1]);\n            }\n            m[{i[1],i[2]}]++;\n        }\n        sort(food.begin(),food.end());\n        sort(table.begin(),table.end(),comp);\n        food.insert(food.begin(),"Table");\n        res.push_back(food);\n        for(auto i:table){\n            vector<string>cur;\n            cur.push_back(i);\n            for(int j=1;j<food.size();j++){\n                cur.push_back(to_string(m[{i,food[j]}]));\n            }\n            res.push_back(cur);\n        }\n        return res;\n    }\n};\n```
[]