Golang solution based on trimming
Created a Trie and followed the deletion procedure. \nSince Golang does not have sorted map, it was necessary to sort the keys of children before deduplication\
Created a Trie and followed the deletion procedure. \nSince Golang does not have sorted map, it was necessary to sort the keys of children before deduplication\n``` \nfunc deleteDuplicateFolder(paths [][]string) [][]string {\n    \n    t := NewTrie()\n    for _,path := range paths {\n        t.insert(path)\n    }\n    t.dedupe(t.root,make(map[string]*TrieNode))\n    \n    ans := [][]string{}\n    for _,value := range t.root.children {\n        path := []string{}\n        t.getPath(value,&path, &ans)\n    }\n    return ans \n}\n\n\ntype Trie struct {\n    root *TrieNode\n}\n\nfunc NewTrie() *Trie {\n    node := NewTrieNode("")\n    return &Trie{node}\n}\n\n\ntype TrieNode struct {\n    name string \n    children map[string]*TrieNode\n    del bool\n}\n\nfunc NewTrieNode(name string) *TrieNode {\n    return &TrieNode{name,make(map[string]*TrieNode),false}\n}\n\nfunc (t *Trie) insert(c []string){\n    node := t.root\n    for i :=0 ; i < len(c);i++ {\n        if child,ok := node.children[c[i]]; ok {\n            node = child\n        } else {\n            child = NewTrieNode(c[i])\n            node.children[c[i]] = child\n            node = child \n        }\n    }\n}\n\nfunc (t *Trie) dedupe(node *TrieNode, seen map[string]*TrieNode)string{\n    var subfolder string\n    keys := make([]string, len(node.children)) \n    i := 0\n    for k := range node.children {\n        keys[i] = k\n        i++\n    }\n    sort.Slice(keys, func(i,j int)bool{\n        return keys[i] < keys[j]\n    })\n    for _,key := range keys {\n        subfolder += t.dedupe(node.children[key],seen)\n    }\n    if len(subfolder) != 0 {\n        if priorNode,ok := seen[subfolder]; ok {\n            priorNode.del = true\n            node.del = true\n        } else {\n            seen[subfolder] = node \n        }\n    }\n    return "("+node.name+subfolder+")"\n}\n\nfunc (t *Trie) getPath(node *TrieNode, path *[]string, ans *[][]string) {\n    if node.del {\n        return\n    }\n    (*path) = append(*path,node.name)\n    finalPath := make([]string,len(*path))\n    copy(finalPath,(*path))\n    (*ans) = append(*ans,finalPath)\n    for _,child := range node.children {\n        t.getPath(child,path,ans)\n    }\n    (*path) = (*path)[:len(*path)-1]\n}\n```
['Go']