c++ using hashmap & set
\n vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        map<int, map<string,int>> mp;\n        set<string> foods;\n        vector<vect
```\n vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        map<int, map<string,int>> mp;\n        set<string> foods;\n        vector<vector<string>> resp; \n        for (int i = 0; i < orders.size(); i++) {\n            auto it = mp.find(stoi(orders[i][1]));\n            if (it != mp.end()) {\n               auto st = it->second.find(orders[i][2]);\n               if (st != it->second.end()) {\n                   st->second++;   \n               } else {\n                   foods.insert(orders[i][2]);\n                   it->second.insert(make_pair(orders[i][2],1)); \n               } \n            } else {\n                map<string, int> st;\n                st.insert(make_pair(orders[i][2], 1));\n                mp.insert(make_pair(stoi(orders[i][1]), st));\n                foods.insert(orders[i][2]);\n            }\n        }\n        vector<string> table;\n        table.push_back("Table");\n        table.insert(table.begin() +1, foods.begin(), foods.end());\n        resp.push_back(table);\n        for (auto it = mp.begin(); it != mp.end(); it++) {\n           vector<string> cur;\n           int i = 1;\n           cur.push_back(to_string(it->first));\n           auto st = it->second.begin();\n           while (i < table.size()) {\n              if (st != it->second.end() && table[i] == st->first) {\n                  cur.push_back(to_string(st->second));\n                  st++;\n              } else {\n                  cur.push_back("0");\n              } \n              i++;  \n           }\n           resp.push_back(cur); \n        }\n        return resp;      \n    }\n};\n```
[]