Accepted C# Solution. Dictionaries + Sort
\n    public class Solution\n    {\n        public IList<IList<string>> DisplayTable(IList<IList<string>> orders)\n        {\n            IList<IList<string>> r
```\n    public class Solution\n    {\n        public IList<IList<string>> DisplayTable(IList<IList<string>> orders)\n        {\n            IList<IList<string>> res = new List<IList<string>>();\n\n            IDictionary<int, IDictionary<string, int>> table2Food2Count = new Dictionary<int, IDictionary<string, int>>();\n            ISet<string> foodSet = new HashSet<string>();\n            ISet<int> tableSets = new HashSet<int>();\n\n            foreach (var order in orders)\n            {\n                var table = int.Parse(order[1]);\n                var food = order[2];\n\n                foodSet.Add(food);\n                tableSets.Add(table);\n\n                if (!table2Food2Count.ContainsKey(table))\n                {\n                    table2Food2Count[table] = new Dictionary<string, int>();\n                }\n\n                if (!table2Food2Count[table].ContainsKey(food))\n                {\n                    table2Food2Count[table][food] = 0;\n                }\n\n                table2Food2Count[table][food]++;\n            }\n\n            res.Add(new List<string>());\n            var foodList = foodSet.ToList();\n            foodList.Sort((f1, f2) => string.CompareOrdinal(f1, f2));\n            res[res.Count - 1].Add("Table");\n            foreach (var f in foodList)\n            {\n                res[res.Count - 1].Add(f);\n            }\n\n            var tableList = tableSets.ToList();\n            tableList.Sort();\n\n            foreach (var t in tableList)\n            {\n                res.Add(new List<string>());\n                res[res.Count - 1].Add(t.ToString());\n\n                foreach (var f in foodList)\n                {\n                    if (!table2Food2Count[t].ContainsKey(f))\n                    {\n                        res[res.Count - 1].Add("0");\n                        continue;\n                    }\n\n                    res[res.Count - 1].Add(table2Food2Count[t][f].ToString());\n                }\n            }\n\n\n            return res;\n        }\n    }\n```
['Sorting']