Java simple TreeMap of TreeMap solution
```\nclass Solution {\n    public List> displayTable(List> orders) {\n        List> res = new ArrayList>();\n        TreeMap> map = new TreeMap<>();\n        Tr
```\nclass Solution {\n    public List<List<String>> displayTable(List<List<String>> orders) {\n        List<List<String>> res = new ArrayList<List<String>>();\n        TreeMap<Integer, TreeMap<String,Integer>> map = new TreeMap<>();\n        TreeMap<String, Integer> ord = new TreeMap<>();\n        for(List<String> l: orders)\n        {\n            String str = l.get(2);\n            int id = Integer.parseInt(l.get(1));\n            if(map.containsKey(id))\n            {\n                \n                    map.get(id).put(str, map.get(id).getOrDefault(str,0) + 1);\n                    ord.put(str,0);\n            }\n            else\n            {\n                TreeMap<String, Integer> temp = new TreeMap<>();\n                map.put(id, temp);\n                    map.get(id).put(str, map.get(id).getOrDefault(str,0) + 1);\n                    ord.put(str,0);\n            }\n        }\n        ArrayList<String> les = new ArrayList<>();\n        les.add("Table");\n        for(String s: ord.keySet())\n        {\n            les.add(s);\n        }\n        res.add(les);\n        \n        for(int i: map.keySet())\n        {\n            ArrayList<String> l1 = new ArrayList<>();\n            String no = String.valueOf(i);\n            l1.add(no);\n            \n            for(String s: ord.keySet())\n            {\n                l1.add(String.valueOf(map.get(i).getOrDefault(s , 0)));\n            }\n            res.add(l1);\n            \n        }\n        return res;\n    }\n}
['Java']