C# linq
C#\n\n\npublic IList<IList<string>> DisplayTable(IList<IList<string>> orders) {\n    // table to dish name to dish count\n\tvar lookup = orders.GroupBy(i => i[1
C#\n\n```\npublic IList<IList<string>> DisplayTable(IList<IList<string>> orders) {\n    // table to dish name to dish count\n\tvar lookup = orders.GroupBy(i => i[1], i => i[2])\n\t.ToDictionary(g => Int32.Parse(g.Key), g => g.GroupBy(k => k).ToDictionary(g2 => g2.Key, g2 => g2.Count()));\n\n\tvar header = new List<string>();\n\theader.Add("Table");\n\tvar dishes = orders.GroupBy(g => g[2], g => g[2]).Select(grp => grp.First()).OrderBy(x => x, StringComparer.Ordinal).ToList();\n\theader.AddRange(dishes);\n\n\tvar result = new List<IList<string>>();\n\tresult.Add(header);\n\n\tvar tables = lookup.Keys.OrderBy(x => x).ToList();\n\n\tforeach(var t in tables) {\n\t\tvar row = new List<string>();\n\t\trow.Add(t.ToString());\n\t\tforeach(var d in dishes) {\n\t\t\trow.Add(lookup[t].ContainsKey(d) ? lookup[t][d].ToString() : "0");\n\t\t}\n\t\tresult.Add(row);\n\t}\n\treturn result;\n}\n```
[]