Find the minimum number of operations (insert, delete, replace) to convert word1 to word2. Classic 2D DP.
Base cases: dp[i][0] = i (delete all), dp[0][j] = j (insert all).
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
minDistance('horse', 'ros')
3