Swift Solution
\nclass Solution {\n  private var subdirsTotal: [String: Bool] = [:]\n  \n  func deleteDuplicateFolder(_ paths: [[String]]) -> [[String]] {\n    var root = Node
```\nclass Solution {\n  private var subdirsTotal: [String: Bool] = [:]\n  \n  func deleteDuplicateFolder(_ paths: [[String]]) -> [[String]] {\n    var root = Node(value: "/")\n    for path in paths {\n      let oldRoot = root\n      createTree(path, &root)\n      root = oldRoot\n    }\n    \n    marker(root)\n    \n    var result: [[String]] = []\n    var temp: [String] = []\n    \n    getTheResult(&result, &temp, root)\n    \n    return result\n  }\n  \n  private func getTheResult(_ result: inout [[String]], _ temp: inout [String], _ root: Node) {\n    for child in root.childs {\n      if subdirsTotal[child.subdirs] != true {\n        temp.append(child.value)\n        result.append(temp)\n        getTheResult(&result, &temp, child)\n        temp.removeLast()\n      }\n    }\n  }\n  \n  private func marker(_ root: Node) -> String {\n    var temp: [String] = []\n    let sorted = root.childs.sorted(by: { $0.value > $1.value })\n    for value in sorted {\n      let sub = marker(value)\n      temp.append(sub)\n    }\n    let str = temp.map { "(\\($0))" }.joined(separator: "")\n    \n    root.subdirs = str\n    if subdirsTotal[str] != nil && temp.count > 0 {\n      subdirsTotal[str] = true\n    } else {\n      subdirsTotal[str] = false\n    }\n    return "(\\(str + root.value))"\n  }\n  \n  private func createTree(_ path: [String], _ root: inout Node) {\n    for i in 0..<path.count {\n      if root.childs.first(where: {$0.value == path[i]}) == nil {\n        let node = Node(value: path[i])\n        root.childs.append(node)\n      }\n      if let node = root.childs.first(where: {$0.value == path[i]}) {\n        root = node\n      }\n    }\n  }\n  \n  private class Node: Hashable {\n    var value: String\n    var childs: [Node] = []\n    var subdirs: String = ""\n    \n    init(value: String) {\n      self.value = value\n    }\n    \n    static func == (lhs: Solution.Node, rhs: Solution.Node) -> Bool {\n      lhs.value == rhs.value\n    }\n    \n    func hash(into hasher: inout Hasher) {\n      hasher.combine(value)\n    }\n  }\n}\n```
[]