C++ Easy Solution | Map , Sort
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n*log(n))$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        unordered_map<string,unordered_map<string,int>> y;\n        unordered_map<string,int> z;\n        int n = orders.size();\n        for(int i=0;i<n;i++){\n            z[orders[i][2]]=1;\n            y[orders[i][1]][orders[i][2]]++;\n        }\n        int e=y.size(),f=z.size();\n        vector<vector<string>> x(e+1,vector<string>(f+1,""));\n        x[0][0]="Table";\n        int j=1;\n        for(auto i:z){\n            x[0][j]=i.first;\n            j++;\n        }\n        sort(x[0].begin()+1,x[0].end());\n        j=1;\n        for(auto i:y){\n            x[j][0]=i.first;\n            for(int k=1;k<f+1;k++){\n                x[j][k]=to_string(i.second[x[0][k]]);\n            }\n            j++;\n        }\n        sort(x.begin()+1, x.end(), [](auto& a, auto& b) {\n            return stoi(a[0]) < stoi(b[0]); \n        });\n        return x;\n\n    }\n};\n```
['C++']