Python dict
\nclass Solution:\n    def displayTable(self, orders: List[List[str]]) -> List[List[str]]:\n        table_map = collections.defaultdict(dict)\n        foods = l
```\nclass Solution:\n    def displayTable(self, orders: List[List[str]]) -> List[List[str]]:\n        table_map = collections.defaultdict(dict)\n        foods = list()\n        for name, table, food in orders:\n            table = int(table)\n            if food not in foods:\n                foods.append(food)\n            if food in table_map[table].keys():\n                table_map[table][food] += 1\n            else:\n                table_map[table][food] = 1\n        foods.sort()\n        res = [["Table"]+foods]\n        for key in sorted(table_map.keys()):\n            l = []\n            l.append(str(key))\n            for food in foods:\n                if food in table_map[key]:\n                    l.append(str(table_map[key][food]))\n                else:\n                    l.append(\'0\')\n            res.append(l)\n        return res\n```
[]