[C++] solution full explain using map and set.Runtime: 316 ms, faster than 81.82%
For test case 1:\norders = [["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],[
For test case 1:\norders = **[["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],["Rous","3","Ceviche"]]**\n\nmap will be like------>\n**Table  |  [Item , Frequency]   :  [Item , Frequency]:----------\n   3         |  [Ceviche , 2]             :  [Fried Chicken , 2]\n 10         |  [Beef Burrito , 1]     :   -----------\n  5          |  [Water , 1]                :   [Ceviche , 1]**\n```\nclass Solution {\npublic:\n    vector<vector<string>> displayTable(vector<vector<string>>& orders) {\n        \n        set<int> table;      //store table\n        set<string> item;  //store unique items to find total number of items\n        map<int,map<string,int>> mp;   //mp->first=Table Number , mp->second= A new map\n\t\t//New map let say nmp will store\n\t\t//nmp->first= Item , nmp->second=frequency of item\n         vector<vector<string>> res;\n        for(auto i:orders)\n        {\n            mp[stoi(i[1])][i[2]]++;    //increse frequency of items\n            item.insert(i[2]);\n            table.insert(stoi(i[1]));\n        }\n        vector<string> v;\n        v.push_back("Table");\n        for ( auto rit = item.begin(); rit != item.end(); rit++)     //creating first row of result\n            v.push_back(*rit);\n        res.push_back(v);                //insert 1st row in result\n        int m=table.size();               //number of column will be m+1; \n        auto u=mp.begin();\n        vector<string> vec;            //store each row\n        while(m--)\n        {\n            vec.push_back(to_string(u->first));      //store table number at 0th index\n            for(int i=1;i<v.size();i++)                     //iterate through 1st row of result\n            {                             \n                if(u->second.find(v[i])!=u->second.end())         //if v[i] present in map it means we have to store its frequency\n                    vec.push_back(to_string(u->second[v[i]]));\n                else\n                    vec.push_back("0");                            //else store 0\n            }\n            u++;                                 //increment iterator of map\n            res.push_back(vec);      //push this row to result\n            vec.clear();\n        }\n       \n        return res;\n    }\n};\n```
['Hash Table', 'C', 'C++']