[Python] Simple and Concise 5 Lines
5 Lines\n\nclass Solution:\n    def displayTable(self, orders: List[List[str]]) -> List[List[str]]:\n        counter, dishes = collections.defaultdict(collectio
5 Lines\n```\nclass Solution:\n    def displayTable(self, orders: List[List[str]]) -> List[List[str]]:\n        counter, dishes = collections.defaultdict(collections.Counter), set()\n        for _, table, dish in orders:\n            dishes.add(dish)\n            counter[table][dish] += 1\n        return [["Table"]+(header:=sorted(list(dishes)))]+[[table]+[str(counter[table][dish]) for dish in header] for table in sorted(counter, key = int)]\n```\n\nEasy to understand version\n```\nclass Solution:\n    def displayTable(self, orders: List[List[str]]) -> List[List[str]]:\n        counter, dishes = collections.defaultdict(collections.Counter), set()\n        for (_, table, dish) in orders:\n            dishes.add(dish)\n            counter[table][dish] += 1\n        \n        header, display_table = sorted(list(dishes)), []\n        for table in sorted(counter, key = int):\n            row = [table]+[str(counter[table][dish]) for dish in header]\n            display_table.append(row)\n        return [["Table"]+header]+display_table\n```\n\n
[]