✔️ 100% Fastest Swift Solution
\nclass Solution {\n    func exist(_ board: [[Character]], _ word: String) -> Bool {\n        let chs = reverseIfNeeded(Array(word))\n        if isValid(board, 
```\nclass Solution {\n    func exist(_ board: [[Character]], _ word: String) -> Bool {\n        let chs = reverseIfNeeded(Array(word))\n        if isValid(board, chs) == false { return false }\n        var res = false\n        \n        func backtrack(_ path: [[Int]], _ position: [Int], _ target: Int) {\n            if res || path.count == target { res = true; return }\n            \n            let char = chs[path.count]\n            let positions = next(board, position, char)\n            var path = path\n            \n            for position in positions {\n                if path.contains(position) { continue }\n                \n                path.append(position)\n                backtrack(path, position, target)\n                path.remove(at: path.count - 1)\n            }\n        }\n        \n        backtrack([], [-1, -1], chs.count)\n        return res\n    }\n\n    \n    func isValid(_ board: [[Character]], _ chars: [Character]) -> Bool {\n        var res = true\n        \n        loop1: for c in chars {\n            var tmp = false\n            \n            loop2: for i in 0..<board.count {\n                for j in 0..<board[0].count {\n                    if board[i][j] == c { tmp = true; break loop2 }\n                }\n            }\n            \n            if tmp == false { res = false; break loop1 }\n        }\n        \n        return res\n    }\n\n    \n    func reverseIfNeeded(_ chars: [Character]) -> [Character] {\n        var headCount = 0\n        var tailCount = 0\n        \n        for c in chars {\n            if c == chars[0] {\n                headCount += 1\n            }\n            if c == chars[chars.count - 1] {\n                tailCount += 1\n            }\n        }\n        \n        if tailCount < headCount {\n            return chars.reversed()\n        \n        } else {\n            return chars\n        }\n    }\n\n    \n    func next(_ board: [[Character]], _ position: [Int], _ char: Character) -> [[Int]] {\n        var res: [[Int]] = []\n        \n        if position[0] == -1 {\n            for i in 0..<board.count {\n                for j in 0..<board[0].count {\n                    if board[i][j] == char {\n                        res.append([i, j])\n                    }\n                }\n            }\n        } else {\n            var c: Character = " "\n            \n            if position[0] > 0 {\n                let i = position[0] - 1\n                let j = position[1]\n                c = board[i][j]\n                c == char ? res.append([i, j]) : ()\n            }\n            \n            if position[0] < board.count - 1 {\n                let i = position[0] + 1\n                let j = position[1]\n                c = board[i][j]\n                c == char ? res.append([i, j]) : ()\n            }\n            \n            if position[1] > 0 {\n                let i = position[0]\n                let j = position[1] - 1\n                c = board[i][j]\n                c == char ? res.append([i, j]) : ()\n            }\n            \n            if position[1] < board[0].count - 1 {\n                let i = position[0]\n                let j = position[1] + 1\n                c = board[i][j]\n                c == char ? res.append([i, j]) : ()\n            }\n        }\n        \n        return res\n    }\n\n}\n```\n\nLet me know in comments if you have any doubts. I will be happy to answer.\n\nPlease upvote if you found the solution useful.
['Swift']