hashmap | sets | c++ | fast and easy
\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        int n = orders.size();\n        set<string>dish;
```\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        int n = orders.size();\n        set<string>dish;\n        set<int>table;\n        for(int i=0; i<n; i++){\n            dish.insert(orders[i][2]);\n            table.insert(stoi(orders[i][1]));\n        }\n\n        vector<vector<string>>ans(table.size()+1, vector<string>(dish.size()+1));\n        ans[0][0] = "Table";\n        for(int i=1; i<=table.size(); i++){\n            for(int j=1; j<=dish.size(); j++){\n                ans[i][j] = "0";\n            }\n        }\n        map<string,int>mp,xp;\n        int i=0;\n        for(auto it = dish.begin(); it!=dish.end(); it++){\n            \n                ans[0][i+1] = *it;\n            \n            mp[*it] = i++;\n        }\n        i=0;\n        for(auto it = table.begin(); it!=table.end(); it++){\n            \n                ans[i+1][0] = to_string(*it);\n            \n            xp[to_string(*it)] = i++;\n        }\n        for(int j=0; j<n; j++){\n            ans[xp[orders[j][1]]+1][mp[orders[j][2]]+1] = to_string(stoi(ans[xp[orders[j][1]]+1][mp[orders[j][2]]+1]) + 1);\n        }\n        \n        return ans;\n    }\n};\n```
['C', 'Ordered Set']