Display Table of Food Orders in a Restaurant
\nStored in map with reference to table number\n\n\nclass Solution \n{\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& nums) \n    {\n
```\nStored in map with reference to table number\n```\n```\nclass Solution \n{\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& nums) \n    {\n         map<int,map<string,int>>mp;\n         set<string>st;\n         int n=nums.size();\n         for(int i=0;i<n;i++)\n         {\n             st.insert(nums[i][2]);\n             mp[stoi(nums[i][1])][nums[i][2]]++;\n         }\n         vector<string>v(st.begin(),st.end());\n         vector<vector<string>>ans;\n         vector<string>v1;\n         v1.push_back("Table");\n         for(int i=0;i<v.size();i++)\n             v1.push_back(v[i]);\n         ans.push_back(v1);\n         for(auto i=mp.begin();i!=mp.end();i++)\n         {\n             vector<string>v2;\n             v2.push_back(to_string(i->first));\n             for(int j=0;j<v.size();j++)\n                 v2.push_back(to_string(i->second[v[j]]));\n             ans.push_back(v2);\n         }\n         return ans; \n    }\n};\n```
['C', 'C++']