C++ easy understand,using unorderd_map ,fast
\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        vector<vector<string> > result;\n        \n     
```\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        vector<vector<string> > result;\n        \n        int n=orders.size();\n        if(!n){\n            return result;\n        }\n        \n        int m=orders[0].size();\n        \n        if(!m){\n            return result;\n        }\n        \n        map<int,map<string,int> > mymap;\n        \n        set<string> dishes;\n        \n        for(auto v:orders){\n            dishes.insert(v[2]);\n            mymap[stoi(v[1])][v[2]]++;            \n        }\n        \n        vector<string> heading(dishes.begin(),dishes.end());\n        heading.insert(heading.begin(),"Table");\n        \n        result.push_back(heading);\n        \n        for(auto it:mymap){\n            vector<string> row;\n            row.push_back(to_string(it.first));\n            map<string,int> mp=it.second;\n            \n            for(string s:dishes){\n                row.push_back(to_string(mp[s]));\n            }\n            \n            result.push_back(row);\n        }\n        \n        return result;\n    }\n};\n```
[]