Fetching algorithms...
GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing rulcode.com — Edit Distance Visualizer & Solution | Rulcode Fetching algorithms... Loading problem details... 34. Edit DistancePRO Hard Topics Companies Hint Understand Before CodingVisualize This ProblemOpen Visualizer Draw Your ApproachDraw Example 1:Input: word1 = "horse", word2 = "ros"Output: 3Explanation: horse -> rorse (replace 'h' with 'r')
rorse -> rose (remove 'r')
rose -> ros (remove 'e')
The minimum edit distance between "horse" and "ros" is 3 (replace 'h' with 'r', remove 'r', remove 'e'). Example 2:Input: word1 = "intention", word2 = "execution"Output: 5Explanation: intention -> inention (remove 't')
inention -> enention (replace 'i' with 'e')
enention -> exention (replace 'n' with 'x')
exention -> exection (replace 'n' with 'c')
exection -> execution (insert 'u')
The minimum edit distance between "intention" and "execution" is 5. Example 3:Input: word1 = "", word2 = "abc"Output: 3Explanation: The minimum edit distance between "" and "abc" is 3 (insert 'a', insert 'b', insert 'c'). Example 4:Input: word1 = "abc", word2 = ""Output: 3Explanation: The minimum edit distance between "abc" and "" is 3 (delete 'a', delete 'b', delete 'c'). Example 5:Input: word1 = "abc", word2 = "abc"Output: 0Explanation: The minimum edit distance between "abc" and "abc" is 0 (no operations needed). Constraints:
Time Complexity O(mn) Space Complexity O(mn) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |