Simple approach using pair,sets and maps
\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        map<pair<string,string>,int> food;\n        set<
```\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        map<pair<string,string>,int> food;\n        set<int> tables;\n        set<string> foodName;\n        \n        for(vector<string> ord : orders){\n            // ord[0] = name of customer\n            // ord[1] = table number (string)\n            // ord[2] = food name\n            tables.insert(stoi(ord[1]));\n            foodName.insert(ord[2]);\n            pair<string,string> foodPair = {ord[2],ord[1]};\n            food[foodPair]++;\n        }\n        vector<vector<string>> ans; \n        vector<string> header;\n        header.push_back("Table");\n        for(auto name:foodName){\n            header.push_back(name);\n        }\n        ans.push_back(header);\n        \n        for(auto tno:tables){\n            vector<string> v;\n            v.push_back(to_string(tno));\n            for(int i=1;i<ans[0].size();++i){\n                string name = ans[0][i];\n                v.push_back(to_string(food[{name,to_string(tno)}]));\n            }\n            ans.push_back(v);\n        }\n        return ans;\n    }\n};\n```
['C++']