[Java] TreeMap & TreeSet
Since tableNumber should be output in an order, use TreeMap as map to hold the orders on each table.\nSince foodItem should be output in an order (alphabetic), 
Since tableNumber should be output in an order, use `TreeMap` as map to hold the orders on each table.\nSince foodItem should be output in an order (alphabetic), use `TreeSet` as set to hold the orders of appeared foodItem\n```\nclass Solution {\n    public List<List<String>> displayTable(List<List<String>> orders) {\n        TreeMap<Integer, Map<String, Integer>> tableOrders = new TreeMap<>();\n        TreeSet<String> foodItems = new TreeSet<>();\n        for (List<String> order : orders) {\n            int tableNumber = Integer.valueOf(order.get(1));\n            String foodItem = order.get(2);\n            foodItems.add(foodItem);\n            tableOrders.putIfAbsent(tableNumber, new HashMap<>());\n            Map<String, Integer> tableOrder = tableOrders.get(tableNumber);\n            tableOrder.put(foodItem, tableOrder.getOrDefault(foodItem, 0) + 1);\n        }\n        List<List<String>> res = new ArrayList<>();\n        List<String> header = new ArrayList<>();\n        header.add("Table");\n        for (String foodItem : foodItems)\n            header.add(foodItem);\n        res.add(header);\n        for (Map.Entry<Integer, Map<String, Integer>> e : tableOrders.entrySet()) {\n            List<String> row = new ArrayList<>();\n            row.add(String.valueOf(e.getKey()));\n            Map<String, Integer> tableOrder = e.getValue();\n            for (String foodItem : foodItems)\n                row.add(String.valueOf(tableOrder.getOrDefault(foodItem, 0)));\n            res.add(row);\n        }\n        return res;\n    }\n}\n```
[]