C# extendable OOPs concept solution
\npublic class Solution {\n    public IList<IList<string>> DisplayTable(IList<IList<string>> orders) {\n        Restaurant restaurant = new Restaurant();\n     
```\npublic class Solution {\n    public IList<IList<string>> DisplayTable(IList<IList<string>> orders) {\n        Restaurant restaurant = new Restaurant();\n        foreach(List<string> order in orders)\n        {\n            restaurant.UpsertTable(Int32.Parse(order[1]),order[2]);\n        }\n        \n        return restaurant.DisplayTables();\n    }\n}\n\nclass Restaurant {\n    Dictionary<int, Table> tables = null;\n    HashSet<string> dishes = null;\n    \n    public Restaurant()\n    {\n        this.tables = new Dictionary<int, Table>();\n        this.dishes = new HashSet<string>();\n    }\n    \n    public void UpsertTable(int tableNum, string dishName)\n    {\n        if(!tables.ContainsKey(tableNum))\n            tables[tableNum] = new Table(tableNum);\n        \n        if(!dishes.Contains(dishName))\n            dishes.Add(dishName);\n        \n        AddDishToTable(tableNum, dishName);\n    }\n    \n    public void AddDishToTable(int tableNum, string dishName)\n    {\n        if(tables[tableNum].orders.ContainsKey(dishName))\n            tables[tableNum].orders[dishName] += 1;\n        else\n            tables[tableNum].orders[dishName] = 1;\n    }\n    \n    public List<string> GetAllDishes()\n    {\n        List<string> listOfDishes = dishes.ToList();\n        listOfDishes = listOfDishes.OrderBy(x => x, StringComparer.Ordinal).ToList();\n        return listOfDishes;\n    }\n    \n    public IList<IList<string>> DisplayTables()\n    {\n        IList<IList<string>> displayTables = new List<IList<string>>();\n        \n        List<string> menuItems = new List<string>(){"Table"};\n        List<string> sotedDishes = GetAllDishes();\n        menuItems.AddRange(sotedDishes);\n        displayTables.Add(menuItems);\n        \n        List<int> tableNums = tables.Keys.ToList();\n        tableNums.Sort();\n        \n        foreach(int tableNumber in tableNums)\n        { \n            List<string> orders = new List<string>(){tableNumber.ToString()};\n            foreach(string dish in sotedDishes)\n            {\n                if(tables[tableNumber].orders.ContainsKey(dish))\n                    orders.Add(tables[tableNumber].orders[dish].ToString());\n                else\n                    orders.Add("0");\n            }\n            displayTables.Add(orders);\n        }\n        \n        return displayTables;\n    }\n}\n\nclass Table {\n    public int tableNumber = 0;\n    public Dictionary<string, int> orders = null;\n    \n    public Table(int tableNumber)\n    {\n        this.tableNumber = tableNumber;\n        this.orders = new Dictionary<string, int>();\n    }\n}\n```
[]