✔️ 100% Fastest Swift Solution
\nclass Solution {\n    func minDistance(_ word1: String, _ word2: String) -> Int {\n        let row = word1.count + 1\n        let col = word2.count + 1\n     
```\nclass Solution {\n    func minDistance(_ word1: String, _ word2: String) -> Int {\n        let row = word1.count + 1\n        let col = word2.count + 1\n        let chs1  = Array(word1)\n        let chs2  = Array(word2)\n        var dp: [[Int]] = Array(repeating: Array(repeating: 0, count: col), count: row)\n        \n        for i in 0..<row { \n            for j in 0..<col {\n                if i == 0 {\n                    dp[i][j] = j\n                \n                } else if j == 0 {\n                    dp[i][j] = i\n                \n                } else if chs1[i - 1] == chs2[j - 1] {\n                    dp[i][j] = dp[i - 1][j - 1]\n                \n                } else {\n                    dp[i][j] = 1 + min(dp[i][j - 1], dp[i - 1][j], dp[i - 1][j - 1])\n                }\n            }\n        }\n        \n        return dp[row - 1][col - 1]\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']