         return res
     }
     
-    private func _dfs(board: [[Character]], _ m: Int, _ n: Int, _ i: Int, _ j: Int, inout _ visited: [[Bool]], inout _ res: [String], _ trie: Trie, _ str: String) {
+    fileprivate func _dfs(_ board: [[Character]], _ m: Int, _ n: Int, _ i: Int, _ j: Int, _ visited: inout [[Bool]], _ res: inout  [String], _ trie: Trie, _ str: String) {
         // beyond matrix
         guard i >= 0 && i < m && j >= 0 && j < n else {
             return

 */

class WordSearchII {
    func findWords(board: [[Character]], _ words: [String]) -> [String] {
        var res = [String]()
  
        let m = board.count
        let n = board[0].count

        let trie = _convertToTrie(words)
        var visited = [[Bool]](count: m, repeatedValue: Array(count: n, repeatedValue: false))
  
        for i in 0..<m {
            for j in 0..<n {
                _dfs(board, m, n, i, j, &visited, &res, trie, "")
            }
        }

        visited[i][j] = false
    }
    
    func _convertToTrie(_ words: [String]) -> Trie {
        let trie = Trie()
  
        for str in words {
