Java - Somewhat brute force but beats 80%
The algorithm as 4 parts\n1. Convert the list to a tree\n2. Traverse the tree in post-order manner and generate a unique hash of all the subnodes in the tree. T
The algorithm as 4 parts\n1. Convert the list to a tree\n2. Traverse the tree in post-order manner and generate a unique hash of all the subnodes in the tree. This is a very important step. The hash is a concatenation of all subnodes under a node. However we need to consider the following\n\t1. Make sure that the children of a node are traversed in a sorted manner as ordering is irrelevant and unless we traverse in a sorted manner we may generate different hashes corresponding to the same set of children for example children [a, b, c, d] should have the same hash as [a, c, b, d]\n\t2. Make sure that you use delimiters while concatinating children labels. Else a->b->c will generate the same hash as a->[b, c].\n3. Map Hashes to a the respective parent. If a Hash has more than one parent mark the parent of deletion\n4. Traverse the tree again to generate the list.\n\n\n```\nclass TreeNode {\n    public TreeNode(String label) {\n        this.label = label;\n    }\n    public String label;\n    public String hash; \n    public boolean deleted;\n    // Ordering of child folders is irrelevant so we store in sorted order.\n    public TreeMap<String, TreeNode> children = new TreeMap();\n    \n    @Override  \n    public int hashCode() { \n        return Character.getNumericValue(label.charAt(0)); \n    }\n    \n    public void print(String justification){\n        System.out.println(String.format("%s %s: %s", justification, label, hash));\n        for (TreeNode node : children.values()){\n            node.print(justification+justification);\n        }\n    }\n}\n\nclass Solution {\n    Map<String, List<TreeNode>> map = new HashMap();\n    List<List<String>> out = new ArrayList();\n    \n    public List<List<String>> deleteDuplicateFolder(List<List<String>> paths) {\n        TreeNode root = new TreeNode("root");\n        for (List<String> path : paths){\n            updateTree(root, path, 0);\n        }\n        \n        \n        for (TreeNode node : root.children.values()) {\n            updateNodeHashCodesMap(node);\n        }\n        \n        // root.print("-");\n        \n        // for(Map.Entry<String, List<TreeNode>> entry : map.entrySet()){\n        //     System.out.println(String.format("%s, %s", entry.getKey(), entry.getValue().size()));\n        // }\n        for (String hashCode : map.keySet()){\n            if (map.get(hashCode).size() > 1) {\n                for(TreeNode node : map.get(hashCode)){\n                    node.deleted = true;\n                }\n            }\n        }\n            \n        for (TreeNode node : root.children.values()) {\n            List<LinkedList<String>> lists = getLists(node);\n            for (LinkedList<String> list : lists) out.add(list);\n        }\n        return out;\n    }\n    \n    \n    private List<LinkedList<String>> getLists(TreeNode node) {\n        List<LinkedList<String>> lists = new ArrayList();\n        if (node.deleted) return lists;\n        LinkedList<String> base = new LinkedList();\n        base.add(node.label);\n        lists.add(base);\n        for (TreeNode child : node.children.values()){\n            List<LinkedList<String>> lsts = getLists(child);\n            for(LinkedList lst : lsts){\n                lst.add(0, node.label);\n                lists.add(lst);\n            }\n        }\n        return lists;\n    }\n    \n    private void updateTree(TreeNode root, List<String> path, int index){\n        if (index < path.size()) {\n            String label = path.get(index);\n            TreeNode node = root.children.getOrDefault(label, new TreeNode(label));\n            root.children.put(label, node);\n            index++;\n            updateTree(node, path, index);\n        }\n    }\n    \n    private void updateNodeHashCodesMap(TreeNode node){\n        StringBuilder sb = new StringBuilder();\n        for (Map.Entry<String, TreeNode> entry: node.children.entrySet()) {\n            TreeNode childNode = entry.getValue();\n            updateNodeHashCodesMap(childNode);\n            sb.append(childNode.label);\n            sb.append(childNode.hash);\n            // Append a delimiter so that we can differentiate when the subfolders are the same but in different levels.\n            sb.append("|");\n           \n        }\n        node.hash = sb.toString();\n        if (node.hash != null && node.hash.length() > 0){\n            List<TreeNode> nodesWithHashCode = map.getOrDefault(node.hash, new ArrayList());\n            nodesWithHashCode.add(node);\n            map.put(node.hash, nodesWithHashCode);\n        }\n    }\n}\n\n\n```
[]